| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "services/window_manager/window_manager_app.h" |
| 6 |
| 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/stl_util.h" |
| 9 #include "mojo/converters/geometry/geometry_type_converters.h" |
| 10 #include "mojo/converters/input_events/input_events_type_converters.h" |
| 11 #include "mojo/public/cpp/application/application_connection.h" |
| 12 #include "mojo/public/cpp/application/application_impl.h" |
| 13 #include "mojo/public/interfaces/application/shell.mojom.h" |
| 14 #include "mojo/services/view_manager/cpp/view.h" |
| 15 #include "mojo/services/view_manager/cpp/view_manager.h" |
| 16 #include "services/window_manager/capture_controller.h" |
| 17 #include "services/window_manager/focus_controller.h" |
| 18 #include "services/window_manager/focus_rules.h" |
| 19 #include "services/window_manager/hit_test.h" |
| 20 #include "services/window_manager/view_event_dispatcher.h" |
| 21 #include "services/window_manager/view_target.h" |
| 22 #include "services/window_manager/view_targeter.h" |
| 23 #include "services/window_manager/window_manager_delegate.h" |
| 24 #include "services/window_manager/window_manager_root.h" |
| 25 |
| 26 using mojo::ApplicationConnection; |
| 27 using mojo::Id; |
| 28 using mojo::ServiceProvider; |
| 29 using mojo::View; |
| 30 using mojo::WindowManager; |
| 31 |
| 32 namespace window_manager { |
| 33 |
| 34 //////////////////////////////////////////////////////////////////////////////// |
| 35 // WindowManagerApp, public: |
| 36 |
| 37 WindowManagerApp::WindowManagerApp( |
| 38 WindowManagerControllerFactory* controller_factory) |
| 39 : app_impl_(nullptr), controller_factory_(controller_factory) {} |
| 40 |
| 41 WindowManagerApp::~WindowManagerApp() {} |
| 42 |
| 43 //////////////////////////////////////////////////////////////////////////////// |
| 44 // WindowManagerApp, ApplicationDelegate implementation: |
| 45 |
| 46 void WindowManagerApp::Initialize(mojo::ApplicationImpl* impl) { |
| 47 app_impl_ = impl; |
| 48 } |
| 49 |
| 50 bool WindowManagerApp::ConfigureIncomingConnection( |
| 51 mojo::ApplicationConnection* connection) { |
| 52 connection->AddService<mojo::WindowManager>(this); |
| 53 return true; |
| 54 } |
| 55 |
| 56 void WindowManagerApp::Create( |
| 57 ApplicationConnection* connection, |
| 58 mojo::InterfaceRequest<mojo::WindowManager> request) { |
| 59 // WindowManagerRoot manages its own lifetime. |
| 60 new WindowManagerRoot(app_impl_, connection, controller_factory_, |
| 61 request.Pass()); |
| 62 } |
| 63 |
| 64 } // namespace window_manager |
| OLD | NEW |