Commit 23a76048 authored by Adam Barth's avatar Adam Barth

Add a bool to indicate whether we're in MojoShell

In MojoShell, we can connect to other applications. This patch adds a bool that
clients can use to check whether that feature is available without needing to
try to connect to an application.
parent 80423ae9
...@@ -48,6 +48,9 @@ class MojoShell { ...@@ -48,6 +48,9 @@ class MojoShell {
} }
final ApplicationConnection _embedderConnection = _initEmbedderConnection(); final ApplicationConnection _embedderConnection = _initEmbedderConnection();
/// Whether [connectToApplication] is able to connect to other applications.
bool get canConnectToOtherApplications => _shell != null;
/// Attempts to connect to an application via the Mojo shell. /// Attempts to connect to an application via the Mojo shell.
ApplicationConnection connectToApplication(String url) { ApplicationConnection connectToApplication(String url) {
if (_shell == null) if (_shell == null)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment