| 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 "mojo/services/window_manager/window_manager_app.h" | 5 #include "mojo/services/window_manager/window_manager_app.h" |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "mojo/aura/aura_init.h" | 9 #include "mojo/aura/aura_init.h" |
| 10 #include "mojo/converters/geometry/geometry_type_converters.h" | 10 #include "mojo/converters/geometry/geometry_type_converters.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 87 |
| 88 //////////////////////////////////////////////////////////////////////////////// | 88 //////////////////////////////////////////////////////////////////////////////// |
| 89 // WindowManagerApp, public: | 89 // WindowManagerApp, public: |
| 90 | 90 |
| 91 WindowManagerApp::WindowManagerApp( | 91 WindowManagerApp::WindowManagerApp( |
| 92 ViewManagerDelegate* view_manager_delegate, | 92 ViewManagerDelegate* view_manager_delegate, |
| 93 WindowManagerDelegate* window_manager_delegate) | 93 WindowManagerDelegate* window_manager_delegate) |
| 94 : shell_(nullptr), | 94 : shell_(nullptr), |
| 95 window_manager_service2_factory_(this), | 95 window_manager_service2_factory_(this), |
| 96 window_manager_factory_(this), | 96 window_manager_factory_(this), |
| 97 window_manager_internal_service_factory_(this), | 97 native_viewport_event_dispatcher_factory_(this), |
| 98 wrapped_view_manager_delegate_(view_manager_delegate), | 98 wrapped_view_manager_delegate_(view_manager_delegate), |
| 99 window_manager_delegate_(window_manager_delegate), | 99 window_manager_delegate_(window_manager_delegate), |
| 100 view_manager_(NULL), | 100 view_manager_(NULL), |
| 101 root_(NULL), | 101 root_(NULL), |
| 102 dummy_delegate_(new DummyDelegate), | 102 dummy_delegate_(new DummyDelegate) { |
| 103 window_manager_client_(nullptr) { | |
| 104 } | 103 } |
| 105 | 104 |
| 106 WindowManagerApp::~WindowManagerApp() {} | 105 WindowManagerApp::~WindowManagerApp() {} |
| 107 | 106 |
| 108 // static | 107 // static |
| 109 View* WindowManagerApp::GetViewForWindow(aura::Window* window) { | 108 View* WindowManagerApp::GetViewForWindow(aura::Window* window) { |
| 110 return window->GetProperty(kViewKey); | 109 return window->GetProperty(kViewKey); |
| 111 } | 110 } |
| 112 | 111 |
| 113 aura::Window* WindowManagerApp::GetWindowForViewId(Id view) { | 112 aura::Window* WindowManagerApp::GetWindowForViewId(Id view) { |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 MessagePipe pipe; | 373 MessagePipe pipe; |
| 375 ApplicationConnection* view_manager_app = | 374 ApplicationConnection* view_manager_app = |
| 376 app->ConnectToApplication("mojo:view_manager"); | 375 app->ConnectToApplication("mojo:view_manager"); |
| 377 ServiceProvider* view_manager_service_provider = | 376 ServiceProvider* view_manager_service_provider = |
| 378 view_manager_app->GetServiceProvider(); | 377 view_manager_app->GetServiceProvider(); |
| 379 view_manager_service_provider->ConnectToService(ViewManagerService::Name_, | 378 view_manager_service_provider->ConnectToService(ViewManagerService::Name_, |
| 380 pipe.handle1.Pass()); | 379 pipe.handle1.Pass()); |
| 381 view_manager_client_ = ViewManagerClientFactory::WeakBindViewManagerToPipe( | 380 view_manager_client_ = ViewManagerClientFactory::WeakBindViewManagerToPipe( |
| 382 pipe.handle0.Pass(), shell_, this).Pass(); | 381 pipe.handle0.Pass(), shell_, this).Pass(); |
| 383 | 382 |
| 384 view_manager_app->AddService(&window_manager_internal_service_factory_); | 383 view_manager_app->AddService(&native_viewport_event_dispatcher_factory_); |
| 384 |
| 385 view_manager_app->ConnectToService(&window_manager_client_); |
| 385 } | 386 } |
| 386 | 387 |
| 387 } // namespace mojo | 388 } // namespace mojo |
| OLD | NEW |