| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/view_manager/view_manager_app.h" | 5 #include "services/view_manager/view_manager_app.h" |
| 6 | 6 |
| 7 #include "mojo/application/application_runner_chromium.h" | 7 #include "mojo/application/application_runner_chromium.h" |
| 8 #include "mojo/common/tracing_impl.h" | |
| 9 #include "mojo/public/c/system/main.h" | 8 #include "mojo/public/c/system/main.h" |
| 10 #include "mojo/public/cpp/application/application_connection.h" | 9 #include "mojo/public/cpp/application/application_connection.h" |
| 11 #include "mojo/public/cpp/application/application_impl.h" | 10 #include "mojo/public/cpp/application/application_impl.h" |
| 12 #include "services/view_manager/client_connection.h" | 11 #include "services/view_manager/client_connection.h" |
| 13 #include "services/view_manager/connection_manager.h" | 12 #include "services/view_manager/connection_manager.h" |
| 14 #include "services/view_manager/display_manager.h" | 13 #include "services/view_manager/display_manager.h" |
| 15 #include "services/view_manager/view_manager_service_impl.h" | 14 #include "services/view_manager/view_manager_service_impl.h" |
| 16 | 15 |
| 17 using mojo::ApplicationConnection; | 16 using mojo::ApplicationConnection; |
| 18 using mojo::ApplicationImpl; | 17 using mojo::ApplicationImpl; |
| 19 using mojo::InterfaceRequest; | 18 using mojo::InterfaceRequest; |
| 20 using mojo::ViewManagerService; | 19 using mojo::ViewManagerService; |
| 21 using mojo::WindowManagerInternalClient; | 20 using mojo::WindowManagerInternalClient; |
| 22 | 21 |
| 23 namespace view_manager { | 22 namespace view_manager { |
| 24 | 23 |
| 25 ViewManagerApp::ViewManagerApp() : wm_app_connection_(nullptr) { | 24 ViewManagerApp::ViewManagerApp() : wm_app_connection_(nullptr) { |
| 26 } | 25 } |
| 27 ViewManagerApp::~ViewManagerApp() {} | 26 ViewManagerApp::~ViewManagerApp() {} |
| 28 | 27 |
| 29 void ViewManagerApp::Initialize(ApplicationImpl* app) { | 28 void ViewManagerApp::Initialize(ApplicationImpl* app) { |
| 30 mojo::TracingImpl::Create(app); | 29 tracing_.Initialize(app); |
| 31 } | 30 } |
| 32 | 31 |
| 33 bool ViewManagerApp::ConfigureIncomingConnection( | 32 bool ViewManagerApp::ConfigureIncomingConnection( |
| 34 ApplicationConnection* connection) { | 33 ApplicationConnection* connection) { |
| 35 if (connection_manager_.get()) { | 34 if (connection_manager_.get()) { |
| 36 VLOG(1) << "ViewManager allows only one window manager connection."; | 35 VLOG(1) << "ViewManager allows only one window manager connection."; |
| 37 return false; | 36 return false; |
| 38 } | 37 } |
| 39 wm_app_connection_ = connection; | 38 wm_app_connection_ = connection; |
| 40 // |connection| originates from the WindowManager. Let it connect directly | 39 // |connection| originates from the WindowManager. Let it connect directly |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 new mojo::Binding<WindowManagerInternalClient>(connection_manager_.get(), | 104 new mojo::Binding<WindowManagerInternalClient>(connection_manager_.get(), |
| 106 request.Pass())); | 105 request.Pass())); |
| 107 wm_internal_client_binding_->set_error_handler(this); | 106 wm_internal_client_binding_->set_error_handler(this); |
| 108 } | 107 } |
| 109 | 108 |
| 110 void ViewManagerApp::OnConnectionError() { | 109 void ViewManagerApp::OnConnectionError() { |
| 111 ApplicationImpl::Terminate(); | 110 ApplicationImpl::Terminate(); |
| 112 } | 111 } |
| 113 | 112 |
| 114 } // namespace view_manager | 113 } // namespace view_manager |
| OLD | NEW |