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.h" | 5 #include "ash/mus/window_manager.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 #include <utility> | 10 #include <utility> |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 input_device_client_ = base::MakeUnique<ui::InputDeviceClient>(); | 119 input_device_client_ = base::MakeUnique<ui::InputDeviceClient>(); |
120 | 120 |
121 blocking_pool_ = blocking_pool; | 121 blocking_pool_ = blocking_pool; |
122 DCHECK(window_manager_client_); | 122 DCHECK(window_manager_client_); |
123 DCHECK(!window_tree_client_); | 123 DCHECK(!window_tree_client_); |
124 window_tree_client_ = std::move(window_tree_client); | 124 window_tree_client_ = std::move(window_tree_client); |
125 | 125 |
126 DCHECK_EQ(nullptr, ash::Shell::window_tree_client()); | 126 DCHECK_EQ(nullptr, ash::Shell::window_tree_client()); |
127 ash::Shell::set_window_tree_client(window_tree_client_.get()); | 127 ash::Shell::set_window_tree_client(window_tree_client_.get()); |
128 | 128 |
129 // TODO(sky): remove and use MUS code. This should really be | 129 // TODO(sky): remove and use MUS code. |
130 // ShouldEnableSimplifiedDisplayManagement(), but as ShellPort hasn't been | 130 if (!Shell::ShouldEnableSimplifiedDisplayManagement(config_)) { |
131 // created yet it can't be used here. | |
132 if (config_ == Config::MASH) { | |
133 // |connector_| is null in some tests. | 131 // |connector_| is null in some tests. |
134 if (connector_) | 132 if (connector_) |
135 connector_->BindInterface(ui::mojom::kServiceName, &display_controller_); | 133 connector_->BindInterface(ui::mojom::kServiceName, &display_controller_); |
136 screen_ = base::MakeUnique<ScreenMus>(display_controller_.get()); | 134 screen_ = base::MakeUnique<ScreenMus>(display_controller_.get()); |
137 display::Screen::SetScreenInstance(screen_.get()); | 135 display::Screen::SetScreenInstance(screen_.get()); |
138 InstallFrameDecorationValues(); | 136 InstallFrameDecorationValues(); |
139 } | 137 } |
140 | 138 |
141 pointer_watcher_event_router_ = | 139 pointer_watcher_event_router_ = |
142 base::MakeUnique<views::PointerWatcherEventRouter>( | 140 base::MakeUnique<views::PointerWatcherEventRouter>( |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 aura::PropertyConverter* WindowManager::GetPropertyConverter() { | 330 aura::PropertyConverter* WindowManager::GetPropertyConverter() { |
333 return property_converter_.get(); | 331 return property_converter_.get(); |
334 } | 332 } |
335 | 333 |
336 void WindowManager::SetWindowManagerClient(aura::WindowManagerClient* client) { | 334 void WindowManager::SetWindowManagerClient(aura::WindowManagerClient* client) { |
337 window_manager_client_ = client; | 335 window_manager_client_ = client; |
338 ash::Shell::set_window_manager_client(client); | 336 ash::Shell::set_window_manager_client(client); |
339 } | 337 } |
340 | 338 |
341 void WindowManager::OnWmConnected() { | 339 void WindowManager::OnWmConnected() { |
342 if (config_ != Config::MUS) | 340 if (!Shell::ShouldEnableSimplifiedDisplayManagement(config_)) |
343 return; | 341 return; |
344 | 342 |
345 CreateShell(nullptr); | 343 CreateShell(nullptr); |
346 if (show_primary_host_on_connect_) | 344 if (show_primary_host_on_connect_) |
347 Shell::GetPrimaryRootWindow()->GetHost()->Show(); | 345 Shell::GetPrimaryRootWindow()->GetHost()->Show(); |
348 InstallFrameDecorationValues(); | 346 InstallFrameDecorationValues(); |
349 } | 347 } |
350 | 348 |
351 void WindowManager::OnWmSetBounds(aura::Window* window, | 349 void WindowManager::OnWmSetBounds(aura::Window* window, |
352 const gfx::Rect& bounds) { | 350 const gfx::Rect& bounds) { |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 bool WindowManager::IsWindowActive(aura::Window* window) { | 574 bool WindowManager::IsWindowActive(aura::Window* window) { |
577 return Shell::Get()->activation_client()->GetActiveWindow() == window; | 575 return Shell::Get()->activation_client()->GetActiveWindow() == window; |
578 } | 576 } |
579 | 577 |
580 void WindowManager::OnWmDeactivateWindow(aura::Window* window) { | 578 void WindowManager::OnWmDeactivateWindow(aura::Window* window) { |
581 Shell::Get()->activation_client()->DeactivateWindow(window); | 579 Shell::Get()->activation_client()->DeactivateWindow(window); |
582 } | 580 } |
583 | 581 |
584 } // namespace mus | 582 } // namespace mus |
585 } // namespace ash | 583 } // namespace ash |
OLD | NEW |