| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 registry_.reset(new ViewRegistry(compositor.Pass())); | 46 registry_.reset(new ViewRegistry(compositor.Pass())); |
| 47 | 47 |
| 48 // Connect to associates. | 48 // Connect to associates. |
| 49 // TODO(jeffbrown): Consider making the launcher register associates | 49 // TODO(jeffbrown): Consider making the launcher register associates |
| 50 // with the view manager or perhaps per view tree. | 50 // with the view manager or perhaps per view tree. |
| 51 std::vector<std::string> associate_urls = command_line->GetArgs(); | 51 std::vector<std::string> associate_urls = command_line->GetArgs(); |
| 52 if (associate_urls.empty()) { | 52 if (associate_urls.empty()) { |
| 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 |
| 56 registry_->ConnectAssociates( | 57 registry_->ConnectAssociates( |
| 57 app_impl_, associate_urls, | 58 app_impl_, associate_urls, |
| 58 base::Bind(&ViewManagerApp::OnAssociateConnectionError, | 59 base::Bind(&ViewManagerApp::OnAssociateConnectionError, |
| 59 base::Unretained(this))); | 60 base::Unretained(this))); |
| 60 } | 61 } |
| 61 | 62 |
| 62 bool ViewManagerApp::ConfigureIncomingConnection( | 63 bool ViewManagerApp::ConfigureIncomingConnection( |
| 63 mojo::ApplicationConnection* connection) { | 64 mojo::ApplicationConnection* connection) { |
| 64 connection->AddService<mojo::ui::ViewManager>(this); | 65 connection->AddService<mojo::ui::ViewManager>(this); |
| 65 return true; | 66 return true; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 81 void ViewManagerApp::OnAssociateConnectionError(const std::string& url) { | 82 void ViewManagerApp::OnAssociateConnectionError(const std::string& url) { |
| 82 LOG(ERROR) << "Exiting due to view associate connection error: url=" << url; | 83 LOG(ERROR) << "Exiting due to view associate connection error: url=" << url; |
| 83 Shutdown(); | 84 Shutdown(); |
| 84 } | 85 } |
| 85 | 86 |
| 86 void ViewManagerApp::Shutdown() { | 87 void ViewManagerApp::Shutdown() { |
| 87 app_impl_->Terminate(); | 88 app_impl_->Terminate(); |
| 88 } | 89 } |
| 89 | 90 |
| 90 } // namespace view_manager | 91 } // namespace view_manager |
| OLD | NEW |