Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: ash/mus/window_manager.cc

Issue 2633293005: Converts mash to use Shell (Closed)
Patch Set: cleanup Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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.h" 5 #include "ash/mus/window_manager.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
11 #include "ash/common/session/session_controller.h" 11 #include "ash/common/session/session_controller.h"
12 #include "ash/common/system/tray/system_tray_delegate.h"
12 #include "ash/common/wm/container_finder.h" 13 #include "ash/common/wm/container_finder.h"
13 #include "ash/common/wm/window_state.h" 14 #include "ash/common/wm/window_state.h"
14 #include "ash/common/wm_window.h" 15 #include "ash/common/wm_window.h"
15 #include "ash/display/screen_position_controller.h"
16 #include "ash/mus/accelerators/accelerator_handler.h" 16 #include "ash/mus/accelerators/accelerator_handler.h"
17 #include "ash/mus/accelerators/accelerator_ids.h" 17 #include "ash/mus/accelerators/accelerator_ids.h"
18 #include "ash/mus/bridge/wm_lookup_mus.h" 18 #include "ash/mus/bridge/wm_lookup_mus.h"
19 #include "ash/mus/bridge/wm_shell_mus.h" 19 #include "ash/mus/bridge/wm_shell_mus.h"
20 #include "ash/mus/move_event_handler.h" 20 #include "ash/mus/move_event_handler.h"
21 #include "ash/mus/non_client_frame_controller.h" 21 #include "ash/mus/non_client_frame_controller.h"
22 #include "ash/mus/property_util.h" 22 #include "ash/mus/property_util.h"
23 #include "ash/mus/root_window_controller.h" 23 #include "ash/mus/root_window_controller.h"
24 #include "ash/mus/screen_mus.h" 24 #include "ash/mus/screen_mus.h"
25 #include "ash/mus/shadow_controller.h" 25 #include "ash/mus/shadow_controller.h"
26 #include "ash/mus/shell_delegate_mus.h" 26 #include "ash/mus/shell_delegate_mus.h"
27 #include "ash/mus/window_manager_observer.h"
28 #include "ash/mus/window_properties.h" 27 #include "ash/mus/window_properties.h"
29 #include "ash/public/cpp/shell_window_ids.h" 28 #include "ash/public/cpp/shell_window_ids.h"
30 #include "ash/root_window_controller.h" 29 #include "ash/root_window_controller.h"
31 #include "ash/shell.h" 30 #include "ash/shell.h"
31 #include "ash/shell_init_params.h"
32 #include "ash/wm/ash_focus_rules.h" 32 #include "ash/wm/ash_focus_rules.h"
33 #include "ash/wm/event_client_impl.h"
34 #include "ash/wm/window_properties.h" 33 #include "ash/wm/window_properties.h"
35 #include "base/memory/ptr_util.h" 34 #include "base/memory/ptr_util.h"
36 #include "services/service_manager/public/cpp/connector.h" 35 #include "services/service_manager/public/cpp/connector.h"
37 #include "services/ui/common/accelerator_util.h" 36 #include "services/ui/common/accelerator_util.h"
38 #include "services/ui/common/types.h" 37 #include "services/ui/common/types.h"
39 #include "services/ui/public/cpp/property_type_converters.h" 38 #include "services/ui/public/cpp/property_type_converters.h"
40 #include "services/ui/public/interfaces/constants.mojom.h" 39 #include "services/ui/public/interfaces/constants.mojom.h"
41 #include "services/ui/public/interfaces/window_manager.mojom.h" 40 #include "services/ui/public/interfaces/window_manager.mojom.h"
42 #include "ui/aura/client/window_parenting_client.h" 41 #include "ui/aura/client/window_parenting_client.h"
43 #include "ui/aura/env.h" 42 #include "ui/aura/env.h"
44 #include "ui/aura/mus/property_converter.h" 43 #include "ui/aura/mus/property_converter.h"
45 #include "ui/aura/mus/window_tree_client.h" 44 #include "ui/aura/mus/window_tree_client.h"
46 #include "ui/aura/mus/window_tree_host_mus.h" 45 #include "ui/aura/mus/window_tree_host_mus.h"
47 #include "ui/aura/window.h" 46 #include "ui/aura/window.h"
48 #include "ui/aura/window_property.h" 47 #include "ui/aura/window_property.h"
49 #include "ui/base/hit_test.h" 48 #include "ui/base/hit_test.h"
50 #include "ui/display/display_observer.h" 49 #include "ui/display/display_observer.h"
51 #include "ui/events/mojo/event.mojom.h" 50 #include "ui/events/mojo/event.mojom.h"
52 #include "ui/views/mus/pointer_watcher_event_router.h" 51 #include "ui/views/mus/pointer_watcher_event_router.h"
53 #include "ui/views/mus/screen_mus.h" 52 #include "ui/views/mus/screen_mus.h"
54 #include "ui/wm/core/capture_controller.h" 53 #include "ui/wm/core/capture_controller.h"
55 #include "ui/wm/core/focus_controller.h"
56 #include "ui/wm/core/wm_state.h" 54 #include "ui/wm/core/wm_state.h"
55 #include "ui/wm/public/activation_client.h"
57 56
58 namespace ash { 57 namespace ash {
59 namespace mus { 58 namespace mus {
60 namespace {
61
62 // TODO: this is temporary until WindowManager create the real Shell (which is
63 // the event target). http://crbug.com/670744.
64 class EventClientImplMus : public EventClientImpl {
65 public:
66 EventClientImplMus() = default;
67 ~EventClientImplMus() override = default;
68
69 // EventClientImpl:
70 ui::EventTarget* GetToplevelEventTarget() override { return nullptr; }
71
72 private:
73 DISALLOW_COPY_AND_ASSIGN(EventClientImplMus);
74 };
75
76 } // namespace
77 59
78 // TODO: need to register OSExchangeDataProviderMus. http://crbug.com/665077. 60 // TODO: need to register OSExchangeDataProviderMus. http://crbug.com/665077.
79 WindowManager::WindowManager(service_manager::Connector* connector) 61 WindowManager::WindowManager(service_manager::Connector* connector)
80 : connector_(connector), 62 : connector_(connector),
81 focus_controller_(base::MakeUnique<::wm::FocusController>(
82 new ::ash::wm::AshFocusRules())),
83 wm_state_(base::MakeUnique<::wm::WMState>()), 63 wm_state_(base::MakeUnique<::wm::WMState>()),
84 property_converter_(base::MakeUnique<aura::PropertyConverter>()), 64 property_converter_(base::MakeUnique<aura::PropertyConverter>()) {
85 event_client_(base::MakeUnique<EventClientImplMus>()),
86 screen_position_controller_(
87 base::MakeUnique<ScreenPositionController>()) {
88 property_converter_->RegisterProperty( 65 property_converter_->RegisterProperty(
89 kPanelAttachedKey, ui::mojom::WindowManager::kPanelAttached_Property); 66 kPanelAttachedKey, ui::mojom::WindowManager::kPanelAttached_Property);
90 property_converter_->RegisterProperty( 67 property_converter_->RegisterProperty(
91 kRenderTitleAreaProperty, 68 kRenderTitleAreaProperty,
92 ui::mojom::WindowManager::kRenderParentTitleArea_Property); 69 ui::mojom::WindowManager::kRenderParentTitleArea_Property);
93 property_converter_->RegisterProperty( 70 property_converter_->RegisterProperty(
94 kShelfItemTypeKey, ui::mojom::WindowManager::kShelfItemType_Property); 71 kShelfItemTypeKey, ui::mojom::WindowManager::kShelfItemType_Property);
95 } 72 }
96 73
97 WindowManager::~WindowManager() { 74 WindowManager::~WindowManager() {
98 Shutdown(); 75 Shutdown();
99 ash::Shell::set_window_tree_client(nullptr); 76 ash::Shell::set_window_tree_client(nullptr);
100 ash::Shell::set_window_manager_client(nullptr); 77 ash::Shell::set_window_manager_client(nullptr);
101 } 78 }
102 79
103 void WindowManager::Init( 80 void WindowManager::Init(
104 std::unique_ptr<aura::WindowTreeClient> window_tree_client, 81 std::unique_ptr<aura::WindowTreeClient> window_tree_client,
105 const scoped_refptr<base::SequencedWorkerPool>& blocking_pool) { 82 const scoped_refptr<base::SequencedWorkerPool>& blocking_pool) {
83 blocking_pool_ = blocking_pool;
106 DCHECK(window_manager_client_); 84 DCHECK(window_manager_client_);
107 DCHECK(!window_tree_client_); 85 DCHECK(!window_tree_client_);
108 window_tree_client_ = std::move(window_tree_client); 86 window_tree_client_ = std::move(window_tree_client);
109 87
110 DCHECK_EQ(nullptr, ash::Shell::window_tree_client()); 88 DCHECK_EQ(nullptr, ash::Shell::window_tree_client());
111 ash::Shell::set_window_tree_client(window_tree_client_.get()); 89 ash::Shell::set_window_tree_client(window_tree_client_.get());
112 90
113 // |connector_| will be null in some tests. 91 // |connector_| will be null in some tests.
114 if (connector_) 92 if (connector_)
115 connector_->BindInterface(ui::mojom::kServiceName, &display_controller_); 93 connector_->BindInterface(ui::mojom::kServiceName, &display_controller_);
(...skipping 11 matching lines...) Expand all
127 ui::mojom::FrameDecorationValues::New(); 105 ui::mojom::FrameDecorationValues::New();
128 const gfx::Insets client_area_insets = 106 const gfx::Insets client_area_insets =
129 NonClientFrameController::GetPreferredClientAreaInsets(); 107 NonClientFrameController::GetPreferredClientAreaInsets();
130 frame_decoration_values->normal_client_area_insets = client_area_insets; 108 frame_decoration_values->normal_client_area_insets = client_area_insets;
131 frame_decoration_values->maximized_client_area_insets = client_area_insets; 109 frame_decoration_values->maximized_client_area_insets = client_area_insets;
132 frame_decoration_values->max_title_bar_button_width = 110 frame_decoration_values->max_title_bar_button_width =
133 NonClientFrameController::GetMaxTitleBarButtonWidth(); 111 NonClientFrameController::GetMaxTitleBarButtonWidth();
134 window_manager_client_->SetFrameDecorationValues( 112 window_manager_client_->SetFrameDecorationValues(
135 std::move(frame_decoration_values)); 113 std::move(frame_decoration_values));
136 114
137 shell_.reset(new WmShellMus(base::MakeUnique<ShellDelegateMus>(connector_),
138 this, pointer_watcher_event_router_.get()));
139 shell_->Initialize(blocking_pool);
140 lookup_.reset(new WmLookupMus); 115 lookup_.reset(new WmLookupMus);
141 } 116 }
142 117
143 aura::client::ActivationClient* WindowManager::activation_client() { 118 void WindowManager::DeleteAllRootWindowControllers() {
144 return focus_controller_.get(); 119 // Primary RootWindowController must be destroyed last.
120 RootWindowController* primary_root_window_controller =
121 GetPrimaryRootWindowController();
122 std::set<RootWindowController*> secondary_root_window_controllers;
123 for (auto& root_window_controller_ptr : root_window_controllers_) {
124 if (root_window_controller_ptr.get() != primary_root_window_controller)
James Cook 2017/01/18 01:00:24 nit: {}
sky 2017/01/18 04:00:07 Done.
125 secondary_root_window_controllers.insert(
126 root_window_controller_ptr.get());
127 }
128 const bool in_shutdown = true;
129 for (RootWindowController* root_window_controller :
130 secondary_root_window_controllers) {
131 DestroyRootWindowController(root_window_controller, in_shutdown);
132 }
133 if (primary_root_window_controller)
134 DestroyRootWindowController(primary_root_window_controller, in_shutdown);
135 DCHECK(root_window_controllers_.empty());
145 } 136 }
146 137
147 aura::Window* WindowManager::NewTopLevelWindow( 138 aura::Window* WindowManager::NewTopLevelWindow(
148 ui::mojom::WindowType window_type, 139 ui::mojom::WindowType window_type,
149 std::map<std::string, std::vector<uint8_t>>* properties) { 140 std::map<std::string, std::vector<uint8_t>>* properties) {
150 RootWindowController* root_window_controller = 141 RootWindowController* root_window_controller =
151 GetRootWindowControllerForNewTopLevelWindow(properties); 142 GetRootWindowControllerForNewTopLevelWindow(properties);
152 aura::Window* window = 143 aura::Window* window =
153 root_window_controller->NewTopLevelWindow(window_type, properties); 144 root_window_controller->NewTopLevelWindow(window_type, properties);
154 if (properties->count( 145 if (properties->count(
(...skipping 28 matching lines...) Expand all
183 void WindowManager::AddAcceleratorHandler(uint16_t id_namespace, 174 void WindowManager::AddAcceleratorHandler(uint16_t id_namespace,
184 AcceleratorHandler* handler) { 175 AcceleratorHandler* handler) {
185 DCHECK_EQ(0u, accelerator_handlers_.count(id_namespace)); 176 DCHECK_EQ(0u, accelerator_handlers_.count(id_namespace));
186 accelerator_handlers_[id_namespace] = handler; 177 accelerator_handlers_[id_namespace] = handler;
187 } 178 }
188 179
189 void WindowManager::RemoveAcceleratorHandler(uint16_t id_namespace) { 180 void WindowManager::RemoveAcceleratorHandler(uint16_t id_namespace) {
190 accelerator_handlers_.erase(id_namespace); 181 accelerator_handlers_.erase(id_namespace);
191 } 182 }
192 183
193 void WindowManager::AddObserver(WindowManagerObserver* observer) {
194 observers_.AddObserver(observer);
195 }
196
197 void WindowManager::RemoveObserver(WindowManagerObserver* observer) {
198 observers_.RemoveObserver(observer);
199 }
200
201 display::mojom::DisplayController* WindowManager::GetDisplayController() { 184 display::mojom::DisplayController* WindowManager::GetDisplayController() {
202 return display_controller_ ? display_controller_.get() : nullptr; 185 return display_controller_ ? display_controller_.get() : nullptr;
203 } 186 }
204 187
205 RootWindowController* WindowManager::CreateRootWindowController( 188 void WindowManager::CreatePrimaryRootWindowController(
James Cook 2017/01/18 01:00:24 per the comment below it sounds like CreateShell()
sky 2017/01/18 04:00:07 Done.
189 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host) {
190 std::unique_ptr<RootWindowController> root_window_controller_ptr(
191 new RootWindowController(
192 this, std::move(window_tree_host), screen_->GetAllDisplays()[0],
193 ash::RootWindowController::RootWindowType::PRIMARY));
194 root_window_controllers_.insert(std::move(root_window_controller_ptr));
195 }
196
197 void WindowManager::CreateShell(
198 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host) {
199 DCHECK(!created_shell_);
200 created_shell_ = true;
201 ShellInitParams init_params;
202 WmShellMus* wm_shell =
203 new WmShellMus(WmWindow::Get(window_tree_host->window()),
204 base::MakeUnique<ShellDelegateMus>(
205 connector_, std::move(system_tray_delegate_)),
206 this, pointer_watcher_event_router_.get());
207 init_params.primary_window_tree_host = window_tree_host.release();
James Cook 2017/01/18 01:00:24 Could init_params.primary_window_tree_host become
sky 2017/01/18 04:00:07 Yes, but it would require other changes. In partic
208 init_params.wm_shell = wm_shell;
209 init_params.blocking_pool = blocking_pool_.get();
210 Shell::CreateInstance(init_params);
211 }
212
213 void WindowManager::CreateRootWindowController(
206 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host, 214 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host,
207 const display::Display& display, 215 const display::Display& display,
208 ash::RootWindowController::RootWindowType root_window_type) { 216 ash::RootWindowController::RootWindowType root_window_type) {
209 // TODO(sky): all of these calls to SetFooClient() are done in 217 // The ash startup sequence creates the Shell, which creates
210 // Shell::InitRootWindow(). When Shell is used these can be removed. 218 // WindowTreeHostManager, which creates the WindowTreeHosts and
211 aura::client::SetFocusClient(window_tree_host->window(), 219 // RootWindowControllers. For mash we are supplied the WindowTreeHost when
212 focus_controller_.get()); 220 // a display is added (and WindowTreeHostManager is not used in mash). Mash
213 aura::client::SetActivationClient(window_tree_host->window(), 221 // waits for the first WindowTreeHost, then creates the shell. As there are
214 focus_controller_.get()); 222 // order dependencies we have to create the RootWindowController at a similar
215 aura::client::SetEventClient(window_tree_host->window(), event_client_.get()); 223 // time as cash, to do that we inject the WindowTreeHost into ShellInitParams.
216 aura::client::SetScreenPositionClient(window_tree_host->window(), 224 // Shell calls to WmShell::InitHosts(), which calls back to
217 screen_position_controller_.get()); 225 // CreatePrimaryRootWindowController().
218 226 if (!created_shell_) {
227 CreateShell(std::move(window_tree_host));
228 return;
229 }
219 std::unique_ptr<RootWindowController> root_window_controller_ptr( 230 std::unique_ptr<RootWindowController> root_window_controller_ptr(
220 new RootWindowController(this, std::move(window_tree_host), display, 231 new RootWindowController(
221 root_window_type)); 232 this, std::move(window_tree_host), display,
222 RootWindowController* root_window_controller = 233 ash::RootWindowController::RootWindowType::SECONDARY));
223 root_window_controller_ptr.get();
224 root_window_controllers_.insert(std::move(root_window_controller_ptr)); 234 root_window_controllers_.insert(std::move(root_window_controller_ptr));
225 235
226 // Create a shelf if a user is already logged in.
227 if (shell_->session_controller()->NumberOfLoggedInUsers())
228 root_window_controller->ash_root_window_controller()->CreateShelf();
229
230 for (auto& observer : observers_)
231 observer.OnRootWindowControllerAdded(root_window_controller);
232
233 for (auto& observer : *screen_->display_list().observers()) 236 for (auto& observer : *screen_->display_list().observers())
234 observer.OnDisplayAdded(root_window_controller->display()); 237 observer.OnDisplayAdded(display);
235
236 return root_window_controller;
237 } 238 }
238 239
239 void WindowManager::DestroyRootWindowController( 240 void WindowManager::DestroyRootWindowController(
240 RootWindowController* root_window_controller) { 241 RootWindowController* root_window_controller,
241 if (root_window_controllers_.size() > 1) { 242 bool in_shutdown) {
243 if (!in_shutdown && root_window_controllers_.size() > 1) {
242 DCHECK_NE(root_window_controller, GetPrimaryRootWindowController()); 244 DCHECK_NE(root_window_controller, GetPrimaryRootWindowController());
243 root_window_controller->ash_root_window_controller()->MoveWindowsTo( 245 root_window_controller->ash_root_window_controller()->MoveWindowsTo(
244 GetPrimaryRootWindowController()->root()); 246 GetPrimaryRootWindowController()->root());
245 } 247 }
246 248
247 root_window_controller->Shutdown(); 249 root_window_controller->Shutdown();
248 250
249 // NOTE: classic ash deleted RootWindowController after a delay (DeleteSoon())
250 // this may need to change to mirror that.
251 for (auto iter = root_window_controllers_.begin(); 251 for (auto iter = root_window_controllers_.begin();
252 iter != root_window_controllers_.end(); ++iter) { 252 iter != root_window_controllers_.end(); ++iter) {
253 if (iter->get() == root_window_controller) { 253 if (iter->get() == root_window_controller) {
254 root_window_controllers_.erase(iter); 254 root_window_controllers_.erase(iter);
255 break; 255 break;
256 } 256 }
257 } 257 }
258 } 258 }
259 259
260 void WindowManager::Shutdown() { 260 void WindowManager::Shutdown() {
261 if (!window_tree_client_) 261 if (!window_tree_client_)
262 return; 262 return;
263 263
264 // Remove the focus from any window. This will prevent overhead and side 264 Shell::DeleteInstance();
265 // effects (e.g. crashes) from changing focus during shutdown.
266 // See bug crbug.com/134502.
267 static_cast<aura::client::FocusClient*>(focus_controller_.get())
268 ->FocusWindow(nullptr);
269
270 // Observers can rely on WmShell from the callback. So notify the observers
271 // before destroying it.
272 for (auto& observer : observers_)
273 observer.OnWindowTreeClientDestroyed();
274
275 // Primary RootWindowController must be destroyed last.
276 RootWindowController* primary_root_window_controller =
277 GetPrimaryRootWindowController();
278 std::set<RootWindowController*> secondary_root_window_controllers;
279 for (auto& root_window_controller_ptr : root_window_controllers_) {
280 if (root_window_controller_ptr.get() != primary_root_window_controller)
281 secondary_root_window_controllers.insert(
282 root_window_controller_ptr.get());
283 }
284 for (RootWindowController* root_window_controller :
285 secondary_root_window_controllers) {
286 DestroyRootWindowController(root_window_controller);
287 }
288 if (primary_root_window_controller)
289 DestroyRootWindowController(primary_root_window_controller);
290
291 DCHECK(root_window_controllers_.empty());
292 265
293 lookup_.reset(); 266 lookup_.reset();
294 shell_->Shutdown();
295 shell_.reset();
296 shadow_controller_.reset(); 267 shadow_controller_.reset();
297 268
298 pointer_watcher_event_router_.reset(); 269 pointer_watcher_event_router_.reset();
299 270
300 window_tree_client_.reset(); 271 window_tree_client_.reset();
301 window_manager_client_ = nullptr; 272 window_manager_client_ = nullptr;
302
303 DCHECK_EQ(screen_.get(), display::Screen::GetScreen());
304 display::Screen::SetScreenInstance(nullptr);
305 } 273 }
306 274
307 RootWindowController* WindowManager::GetPrimaryRootWindowController() { 275 RootWindowController* WindowManager::GetPrimaryRootWindowController() {
308 return RootWindowController::ForWindow(WmShell::Get() 276 return RootWindowController::ForWindow(WmShell::Get()
309 ->GetPrimaryRootWindowController() 277 ->GetPrimaryRootWindowController()
310 ->GetWindow() 278 ->GetWindow()
311 ->aura_window()); 279 ->aura_window());
312 } 280 }
313 281
314 RootWindowController* 282 RootWindowController*
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 ? ash::RootWindowController::RootWindowType::PRIMARY 400 ? ash::RootWindowController::RootWindowType::PRIMARY
433 : ash::RootWindowController::RootWindowType::SECONDARY; 401 : ash::RootWindowController::RootWindowType::SECONDARY;
434 CreateRootWindowController(std::move(window_tree_host), display, 402 CreateRootWindowController(std::move(window_tree_host), display,
435 root_window_type); 403 root_window_type);
436 } 404 }
437 405
438 void WindowManager::OnWmDisplayRemoved( 406 void WindowManager::OnWmDisplayRemoved(
439 aura::WindowTreeHostMus* window_tree_host) { 407 aura::WindowTreeHostMus* window_tree_host) {
440 for (auto& root_window_controller_ptr : root_window_controllers_) { 408 for (auto& root_window_controller_ptr : root_window_controllers_) {
441 if (root_window_controller_ptr->window_tree_host() == window_tree_host) { 409 if (root_window_controller_ptr->window_tree_host() == window_tree_host) {
442 DestroyRootWindowController(root_window_controller_ptr.get()); 410 const bool in_shutdown = false;
411 DestroyRootWindowController(root_window_controller_ptr.get(),
412 in_shutdown);
443 break; 413 break;
444 } 414 }
445 } 415 }
446 } 416 }
447 417
448 void WindowManager::OnWmDisplayModified(const display::Display& display) { 418 void WindowManager::OnWmDisplayModified(const display::Display& display) {
449 for (auto& controller : root_window_controllers_) { 419 for (auto& controller : root_window_controllers_) {
450 if (controller->display().id() == display.id()) { 420 if (controller->display().id() == display.id()) {
451 controller->SetDisplay(display); 421 controller->SetDisplay(display);
452 // The root window will be resized by the window server. 422 // The root window will be resized by the window server.
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 const gfx::Insets& insets, 468 const gfx::Insets& insets,
499 const std::vector<gfx::Rect>& additional_client_areas) { 469 const std::vector<gfx::Rect>& additional_client_areas) {
500 NonClientFrameController* non_client_frame_controller = 470 NonClientFrameController* non_client_frame_controller =
501 NonClientFrameController::Get(window); 471 NonClientFrameController::Get(window);
502 if (!non_client_frame_controller) 472 if (!non_client_frame_controller)
503 return; 473 return;
504 non_client_frame_controller->SetClientArea(insets, additional_client_areas); 474 non_client_frame_controller->SetClientArea(insets, additional_client_areas);
505 } 475 }
506 476
507 bool WindowManager::IsWindowActive(aura::Window* window) { 477 bool WindowManager::IsWindowActive(aura::Window* window) {
508 return activation_client()->GetActiveWindow() == window; 478 return Shell::GetInstance()->activation_client()->GetActiveWindow() == window;
509 } 479 }
510 480
511 void WindowManager::OnWmDeactivateWindow(aura::Window* window) { 481 void WindowManager::OnWmDeactivateWindow(aura::Window* window) {
512 activation_client()->DeactivateWindow(window); 482 Shell::GetInstance()->activation_client()->DeactivateWindow(window);
513 } 483 }
514 484
515 } // namespace mus 485 } // namespace mus
516 } // namespace ash 486 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698