Chromium Code Reviews| 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 "ash/mus/window_manager_application.h" | 5 #include "ash/mus/window_manager_application.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "ash/mus/accelerator_registrar_impl.h" | 9 #include "ash/mus/accelerator_registrar_impl.h" |
| 10 #include "ash/mus/root_window_controller.h" | 10 #include "ash/mus/root_window_controller.h" |
| 11 #include "ash/mus/shelf_layout_impl.h" | 11 #include "ash/mus/shelf_layout_impl.h" |
| 12 #include "ash/mus/user_window_controller_impl.h" | 12 #include "ash/mus/user_window_controller_impl.h" |
| 13 #include "ash/mus/window_manager.h" | 13 #include "ash/mus/window_manager.h" |
| 14 #include "base/bind.h" | 14 #include "base/bind.h" |
| 15 #include "base/memory/ptr_util.h" | 15 #include "base/memory/ptr_util.h" |
| 16 #include "components/mus/common/event_matcher_util.h" | 16 #include "components/mus/common/event_matcher_util.h" |
| 17 #include "components/mus/common/gpu_service.h" | 17 #include "components/mus/common/gpu_service.h" |
| 18 #include "components/mus/public/cpp/window.h" | 18 #include "components/mus/public/cpp/window.h" |
| 19 #include "components/mus/public/cpp/window_tree_client.h" | 19 #include "components/mus/public/cpp/window_tree_client.h" |
| 20 #include "services/shell/public/cpp/connection.h" | 20 #include "services/shell/public/cpp/connection.h" |
| 21 #include "services/shell/public/cpp/connector.h" | 21 #include "services/shell/public/cpp/connector.h" |
| 22 #include "services/tracing/public/cpp/tracing_impl.h" | 22 #include "services/tracing/public/cpp/tracing_impl.h" |
| 23 #include "ui/events/event.h" | 23 #include "ui/events/event.h" |
| 24 #include "ui/views/mus/aura_init.h" | 24 #include "ui/views/mus/aura_init.h" |
| 25 | 25 |
| 26 #if defined(OS_CHROMEOS) | |
| 27 #include "chromeos/dbus/dbus_thread_manager.h" | |
| 28 #endif | |
| 29 | |
| 26 namespace ash { | 30 namespace ash { |
| 27 namespace mus { | 31 namespace mus { |
| 28 | 32 |
| 29 WindowManagerApplication::WindowManagerApplication() | 33 WindowManagerApplication::WindowManagerApplication() |
| 30 : connector_(nullptr), screenlock_state_listener_binding_(this) {} | 34 : connector_(nullptr), screenlock_state_listener_binding_(this) { |
| 35 #if defined(OS_CHROMEOS) | |
| 36 chromeos::DBusThreadManager::Initialize(); | |
|
James Cook
2016/07/01 23:17:36
I put this here instead of in WMA::Initialize() be
| |
| 37 #endif | |
| 38 } | |
| 31 | 39 |
| 32 WindowManagerApplication::~WindowManagerApplication() { | 40 WindowManagerApplication::~WindowManagerApplication() { |
| 33 // AcceleratorRegistrarImpl removes an observer in its destructor. Destroy | 41 // AcceleratorRegistrarImpl removes an observer in its destructor. Destroy |
| 34 // it early on. | 42 // it early on. |
| 35 std::set<AcceleratorRegistrarImpl*> accelerator_registrars( | 43 std::set<AcceleratorRegistrarImpl*> accelerator_registrars( |
| 36 accelerator_registrars_); | 44 accelerator_registrars_); |
| 37 for (AcceleratorRegistrarImpl* registrar : accelerator_registrars) | 45 for (AcceleratorRegistrarImpl* registrar : accelerator_registrars) |
| 38 registrar->Destroy(); | 46 registrar->Destroy(); |
| 39 | 47 |
| 40 // Destroy the WindowManager while still valid. This way we ensure | 48 // Destroy the WindowManager while still valid. This way we ensure |
| 41 // OnWillDestroyRootWindowController() is called (if it hasn't been already). | 49 // OnWillDestroyRootWindowController() is called (if it hasn't been already). |
| 42 window_manager_.reset(); | 50 window_manager_.reset(); |
| 51 | |
| 52 #if defined(OS_CHROMEOS) | |
| 53 chromeos::DBusThreadManager::Shutdown(); | |
| 54 #endif | |
| 43 } | 55 } |
| 44 | 56 |
| 45 void WindowManagerApplication::OnAcceleratorRegistrarDestroyed( | 57 void WindowManagerApplication::OnAcceleratorRegistrarDestroyed( |
| 46 AcceleratorRegistrarImpl* registrar) { | 58 AcceleratorRegistrarImpl* registrar) { |
| 47 accelerator_registrars_.erase(registrar); | 59 accelerator_registrars_.erase(registrar); |
| 48 } | 60 } |
| 49 | 61 |
| 50 void WindowManagerApplication::InitWindowManager( | 62 void WindowManagerApplication::InitWindowManager( |
| 51 ::mus::WindowTreeClient* window_tree_client) { | 63 ::mus::WindowTreeClient* window_tree_client) { |
| 52 window_manager_->Init(window_tree_client); | 64 window_manager_->Init(window_tree_client); |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 160 RootWindowController* controller) { | 172 RootWindowController* controller) { |
| 161 // TODO(msw): this isn't right, ownership should belong in WindowManager | 173 // TODO(msw): this isn't right, ownership should belong in WindowManager |
| 162 // and/or RootWindowController. But this is temporary until we get rid of | 174 // and/or RootWindowController. But this is temporary until we get rid of |
| 163 // sysui. | 175 // sysui. |
| 164 shelf_layout_.reset(); | 176 shelf_layout_.reset(); |
| 165 user_window_controller_.reset(); | 177 user_window_controller_.reset(); |
| 166 } | 178 } |
| 167 | 179 |
| 168 } // namespace mus | 180 } // namespace mus |
| 169 } // namespace ash | 181 } // namespace ash |
| OLD | NEW |