| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "services/ui/view_manager/view_manager_app.h" | 5 #include "services/ui/view_manager/view_manager_app.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 // TODO(jeffbrown): Replace this hardcoded list. | 53 // TODO(jeffbrown): Replace this hardcoded list. |
| 54 associate_urls.push_back("mojo:input_manager_service"); | 54 associate_urls.push_back("mojo:input_manager_service"); |
| 55 } | 55 } |
| 56 registry_->ConnectAssociates( | 56 registry_->ConnectAssociates( |
| 57 app_impl_, associate_urls, | 57 app_impl_, associate_urls, |
| 58 base::Bind(&ViewManagerApp::OnAssociateConnectionError, | 58 base::Bind(&ViewManagerApp::OnAssociateConnectionError, |
| 59 base::Unretained(this))); | 59 base::Unretained(this))); |
| 60 } | 60 } |
| 61 | 61 |
| 62 bool ViewManagerApp::ConfigureIncomingConnection( | 62 bool ViewManagerApp::ConfigureIncomingConnection( |
| 63 mojo::ApplicationConnection* connection) { | 63 mojo::ServiceProviderImpl* service_provider_impl) { |
| 64 connection->GetServiceProviderImpl().AddService<mojo::ui::ViewManager>([this]( | 64 service_provider_impl->AddService<mojo::ui::ViewManager>([this]( |
| 65 const mojo::ConnectionContext& connection_context, | 65 const mojo::ConnectionContext& connection_context, |
| 66 mojo::InterfaceRequest<mojo::ui::ViewManager> view_manager_request) { | 66 mojo::InterfaceRequest<mojo::ui::ViewManager> view_manager_request) { |
| 67 DCHECK(registry_); | 67 DCHECK(registry_); |
| 68 view_managers_.AddBinding(new ViewManagerImpl(registry_.get()), | 68 view_managers_.AddBinding(new ViewManagerImpl(registry_.get()), |
| 69 view_manager_request.Pass()); | 69 view_manager_request.Pass()); |
| 70 }); | 70 }); |
| 71 return true; | 71 return true; |
| 72 } | 72 } |
| 73 | 73 |
| 74 void ViewManagerApp::OnCompositorConnectionError() { | 74 void ViewManagerApp::OnCompositorConnectionError() { |
| 75 LOG(ERROR) << "Exiting due to compositor connection error."; | 75 LOG(ERROR) << "Exiting due to compositor connection error."; |
| 76 Shutdown(); | 76 Shutdown(); |
| 77 } | 77 } |
| 78 | 78 |
| 79 void ViewManagerApp::OnAssociateConnectionError(const std::string& url) { | 79 void ViewManagerApp::OnAssociateConnectionError(const std::string& url) { |
| 80 LOG(ERROR) << "Exiting due to view associate connection error: url=" << url; | 80 LOG(ERROR) << "Exiting due to view associate connection error: url=" << url; |
| 81 Shutdown(); | 81 Shutdown(); |
| 82 } | 82 } |
| 83 | 83 |
| 84 void ViewManagerApp::Shutdown() { | 84 void ViewManagerApp::Shutdown() { |
| 85 app_impl_->Terminate(); | 85 app_impl_->Terminate(); |
| 86 } | 86 } |
| 87 | 87 |
| 88 } // namespace view_manager | 88 } // namespace view_manager |
| OLD | NEW |