| 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/common/material_design/material_design_controller.h" | 9 #include "ash/common/material_design/material_design_controller.h" |
| 10 #include "ash/common/mojo_interface_factory.h" | 10 #include "ash/common/mojo_interface_factory.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 #include "chromeos/dbus/dbus_thread_manager.h" | 33 #include "chromeos/dbus/dbus_thread_manager.h" |
| 34 #include "chromeos/network/network_connect.h" | 34 #include "chromeos/network/network_connect.h" |
| 35 #include "chromeos/network/network_handler.h" | 35 #include "chromeos/network/network_handler.h" |
| 36 #include "chromeos/system/fake_statistics_provider.h" | 36 #include "chromeos/system/fake_statistics_provider.h" |
| 37 #include "device/bluetooth/dbus/bluez_dbus_manager.h" // nogncheck | 37 #include "device/bluetooth/dbus/bluez_dbus_manager.h" // nogncheck |
| 38 #endif | 38 #endif |
| 39 | 39 |
| 40 namespace ash { | 40 namespace ash { |
| 41 namespace mus { | 41 namespace mus { |
| 42 | 42 |
| 43 WindowManagerApplication::WindowManagerApplication() | 43 WindowManagerApplication::WindowManagerApplication() {} |
| 44 : screenlock_state_listener_binding_(this) {} | |
| 45 | 44 |
| 46 WindowManagerApplication::~WindowManagerApplication() { | 45 WindowManagerApplication::~WindowManagerApplication() { |
| 47 // Destroy the WindowManager while still valid. This way we ensure | 46 // Destroy the WindowManager while still valid. This way we ensure |
| 48 // OnWillDestroyRootWindowController() is called (if it hasn't been already). | 47 // OnWillDestroyRootWindowController() is called (if it hasn't been already). |
| 49 window_manager_.reset(); | 48 window_manager_.reset(); |
| 50 | 49 |
| 51 if (blocking_pool_) { | 50 if (blocking_pool_) { |
| 52 // Like BrowserThreadImpl, the goal is to make it impossible for ash to | 51 // Like BrowserThreadImpl, the goal is to make it impossible for ash to |
| 53 // 'infinite loop' during shutdown, but to reasonably expect that all | 52 // 'infinite loop' during shutdown, but to reasonably expect that all |
| 54 // BLOCKING_SHUTDOWN tasks queued during shutdown get run. There's nothing | 53 // BLOCKING_SHUTDOWN tasks queued during shutdown get run. There's nothing |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 kMaxNumberThreads, kThreadNamePrefix, base::TaskPriority::USER_VISIBLE); | 143 kMaxNumberThreads, kThreadNamePrefix, base::TaskPriority::USER_VISIBLE); |
| 145 InitWindowManager(std::move(window_tree_client), blocking_pool_); | 144 InitWindowManager(std::move(window_tree_client), blocking_pool_); |
| 146 } | 145 } |
| 147 | 146 |
| 148 bool WindowManagerApplication::OnConnect( | 147 bool WindowManagerApplication::OnConnect( |
| 149 const service_manager::ServiceInfo& remote_info, | 148 const service_manager::ServiceInfo& remote_info, |
| 150 service_manager::InterfaceRegistry* registry) { | 149 service_manager::InterfaceRegistry* registry) { |
| 151 // Register services used in both classic ash and mash. | 150 // Register services used in both classic ash and mash. |
| 152 mojo_interface_factory::RegisterInterfaces( | 151 mojo_interface_factory::RegisterInterfaces( |
| 153 registry, base::ThreadTaskRunnerHandle::Get()); | 152 registry, base::ThreadTaskRunnerHandle::Get()); |
| 154 | |
| 155 if (remote_info.identity.name() == "mash_session") { | |
| 156 context()->connector()->ConnectToInterface(remote_info.identity, &session_); | |
| 157 session_->AddScreenlockStateListener( | |
| 158 screenlock_state_listener_binding_.CreateInterfacePtrAndBind()); | |
| 159 } | |
| 160 return true; | 153 return true; |
| 161 } | 154 } |
| 162 | 155 |
| 163 void WindowManagerApplication::ScreenlockStateChanged(bool locked) { | |
| 164 window_manager_->SetScreenLocked(locked); | |
| 165 } | |
| 166 | |
| 167 } // namespace mus | 156 } // namespace mus |
| 168 } // namespace ash | 157 } // namespace ash |
| OLD | NEW |