Chromium Code Reviews| Index: services/ui/launcher/launch_instance.cc |
| diff --git a/services/ui/launcher/launch_instance.cc b/services/ui/launcher/launch_instance.cc |
| index c2aa2cbf26146038d47dec8fd4d115f81db39e97..cf67635d0cbe00d62beec1419ff3b1e6a588e081 100644 |
| --- a/services/ui/launcher/launch_instance.cc |
| +++ b/services/ui/launcher/launch_instance.cc |
| @@ -40,6 +40,24 @@ void LaunchInstance::Launch() { |
| view_manager_.set_connection_error_handler(base::Bind( |
| &LaunchInstance::OnViewManagerConnectionError, base::Unretained(this))); |
| + /// Connect to ViewAssociates. |
| + // TODO(mikejurka): get this from the commandline? |
| + std::vector<std::string> associate_urls; /// = command_line->GetArgs(); |
| + if (associate_urls.empty()) { |
| + // TODO(jeffbrown): Replace this hardcoded list. |
| + associate_urls.push_back("mojo:input_manager_service"); |
| + } |
| + |
| + for (const auto& url : associate_urls) { |
| + DVLOG(2) << "Connecting to ViewAssociate " << url; |
| + // Connect to the ViewAssociate. |
| + mojo::ui::ViewAssociatePtr associate; |
| + mojo::ConnectToService(app_impl_->shell(), url, GetProxy(&associate)); |
| + |
| + // Wire up the associate to the ViewManager. |
| + view_manager_->RegisterViewAssociate(associate.Pass(), url); |
| + } |
| + |
| InitViewport(); |
| mojo::ui::ViewProviderPtr client_view_provider; |
| @@ -50,6 +68,15 @@ void LaunchInstance::Launch() { |
| nullptr); |
| } |
| +void LaunchInstance::OnViewAssociateConnectionError( |
| + const mojo::String& label, |
| + const OnViewAssociateConnectionErrorCallback& callback) { |
| + LOG(ERROR) << "Exiting due to view associate connection error."; |
| + // TODO(mikejurka): should we even be running this callback? |
|
jeffbrown
2016/05/17 00:44:49
yes, all callbacks have to be invoked (unless you
|
| + callback.Run(); |
| + shutdown_callback_.Run(); |
| +}; |
| + |
| void LaunchInstance::OnCompositorConnectionError() { |
| LOG(ERROR) << "Exiting due to compositor connection error."; |
| shutdown_callback_.Run(); |