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.
This commit is contained in:
parent
80423ae922
commit
23a7604829
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user