| 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 "mash/wm/window_manager_application.h" | 5 #include "mash/wm/window_manager_application.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/ptr_util.h" |
| 10 #include "components/mus/public/cpp/event_matcher.h" | 11 #include "components/mus/public/cpp/event_matcher.h" |
| 11 #include "components/mus/public/cpp/window.h" | 12 #include "components/mus/public/cpp/window.h" |
| 12 #include "components/mus/public/interfaces/window_manager_factory.mojom.h" | 13 #include "components/mus/public/interfaces/window_manager_factory.mojom.h" |
| 13 #include "mash/wm/accelerator_registrar_impl.h" | 14 #include "mash/wm/accelerator_registrar_impl.h" |
| 14 #include "mash/wm/root_window_controller.h" | 15 #include "mash/wm/root_window_controller.h" |
| 15 #include "mash/wm/root_windows_observer.h" | 16 #include "mash/wm/root_windows_observer.h" |
| 16 #include "mash/wm/user_window_controller_impl.h" | 17 #include "mash/wm/user_window_controller_impl.h" |
| 17 #include "mojo/converters/input_events/input_events_type_converters.h" | 18 #include "mojo/converters/input_events/input_events_type_converters.h" |
| 18 #include "mojo/services/tracing/public/cpp/tracing_impl.h" | 19 #include "mojo/services/tracing/public/cpp/tracing_impl.h" |
| 19 #include "mojo/shell/public/cpp/connection.h" | 20 #include "mojo/shell/public/cpp/connection.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 return true; | 128 return true; |
| 128 } | 129 } |
| 129 | 130 |
| 130 void WindowManagerApplication::Create( | 131 void WindowManagerApplication::Create( |
| 131 mojo::Connection* connection, | 132 mojo::Connection* connection, |
| 132 mojo::InterfaceRequest<mash::wm::mojom::UserWindowController> request) { | 133 mojo::InterfaceRequest<mash::wm::mojom::UserWindowController> request) { |
| 133 if (!root_controllers_.empty() && (*root_controllers_.begin())->root()) { | 134 if (!root_controllers_.empty() && (*root_controllers_.begin())->root()) { |
| 134 user_window_controller_binding_.AddBinding(user_window_controller_.get(), | 135 user_window_controller_binding_.AddBinding(user_window_controller_.get(), |
| 135 std::move(request)); | 136 std::move(request)); |
| 136 } else { | 137 } else { |
| 137 user_window_controller_requests_.push_back(make_scoped_ptr( | 138 user_window_controller_requests_.push_back(base::WrapUnique( |
| 138 new mojo::InterfaceRequest<mash::wm::mojom::UserWindowController>( | 139 new mojo::InterfaceRequest<mash::wm::mojom::UserWindowController>( |
| 139 std::move(request)))); | 140 std::move(request)))); |
| 140 } | 141 } |
| 141 } | 142 } |
| 142 | 143 |
| 143 void WindowManagerApplication::Create( | 144 void WindowManagerApplication::Create( |
| 144 mojo::Connection* connection, | 145 mojo::Connection* connection, |
| 145 mojo::InterfaceRequest<mus::mojom::AcceleratorRegistrar> request) { | 146 mojo::InterfaceRequest<mus::mojom::AcceleratorRegistrar> request) { |
| 146 static int accelerator_registrar_count = 0; | 147 static int accelerator_registrar_count = 0; |
| 147 if (accelerator_registrar_count == std::numeric_limits<int>::max()) { | 148 if (accelerator_registrar_count == std::numeric_limits<int>::max()) { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 160 | 161 |
| 161 void WindowManagerApplication::CreateWindowManager( | 162 void WindowManagerApplication::CreateWindowManager( |
| 162 mus::mojom::DisplayPtr display, | 163 mus::mojom::DisplayPtr display, |
| 163 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> client_request) { | 164 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> client_request) { |
| 164 root_controllers_.insert(RootWindowController::CreateFromDisplay( | 165 root_controllers_.insert(RootWindowController::CreateFromDisplay( |
| 165 this, std::move(display), std::move(client_request))); | 166 this, std::move(display), std::move(client_request))); |
| 166 } | 167 } |
| 167 | 168 |
| 168 } // namespace wm | 169 } // namespace wm |
| 169 } // namespace mash | 170 } // namespace mash |
| OLD | NEW |