| 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 <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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. | 129 // TODO(sky): remove and use MUS code. |
| 130 if (config_ == Config::MASH) { | 130 if (!Shell::ShouldEnableSimplifiedDisplayManagement(config_)) { |
| 131 // |connector_| is null in some tests. | 131 // |connector_| is null in some tests. |
| 132 if (connector_) | 132 if (connector_) |
| 133 connector_->BindInterface(ui::mojom::kServiceName, &display_controller_); | 133 connector_->BindInterface(ui::mojom::kServiceName, &display_controller_); |
| 134 screen_ = base::MakeUnique<ScreenMus>(display_controller_.get()); | 134 screen_ = base::MakeUnique<ScreenMus>(display_controller_.get()); |
| 135 display::Screen::SetScreenInstance(screen_.get()); | 135 display::Screen::SetScreenInstance(screen_.get()); |
| 136 } | 136 } |
| 137 | 137 |
| 138 pointer_watcher_event_router_ = | 138 pointer_watcher_event_router_ = |
| 139 base::MakeUnique<views::PointerWatcherEventRouter>( | 139 base::MakeUnique<views::PointerWatcherEventRouter>( |
| 140 window_tree_client_.get()); | 140 window_tree_client_.get()); |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 aura::PropertyConverter* WindowManager::GetPropertyConverter() { | 328 aura::PropertyConverter* WindowManager::GetPropertyConverter() { |
| 329 return property_converter_.get(); | 329 return property_converter_.get(); |
| 330 } | 330 } |
| 331 | 331 |
| 332 void WindowManager::SetWindowManagerClient(aura::WindowManagerClient* client) { | 332 void WindowManager::SetWindowManagerClient(aura::WindowManagerClient* client) { |
| 333 window_manager_client_ = client; | 333 window_manager_client_ = client; |
| 334 ash::Shell::set_window_manager_client(client); | 334 ash::Shell::set_window_manager_client(client); |
| 335 } | 335 } |
| 336 | 336 |
| 337 void WindowManager::OnWmConnected() { | 337 void WindowManager::OnWmConnected() { |
| 338 if (config_ != Config::MUS) | 338 if (!Shell::ShouldEnableSimplifiedDisplayManagement(config_)) |
| 339 return; | 339 return; |
| 340 | 340 |
| 341 CreateShell(nullptr); | 341 CreateShell(nullptr); |
| 342 if (show_primary_host_on_connect_) | 342 if (show_primary_host_on_connect_) |
| 343 Shell::GetPrimaryRootWindow()->GetHost()->Show(); | 343 Shell::GetPrimaryRootWindow()->GetHost()->Show(); |
| 344 } | 344 } |
| 345 | 345 |
| 346 void WindowManager::OnWmSetBounds(aura::Window* window, | 346 void WindowManager::OnWmSetBounds(aura::Window* window, |
| 347 const gfx::Rect& bounds) { | 347 const gfx::Rect& bounds) { |
| 348 // TODO(sky): this indirectly sets bounds, which is against what | 348 // TODO(sky): this indirectly sets bounds, which is against what |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 bool WindowManager::IsWindowActive(aura::Window* window) { | 571 bool WindowManager::IsWindowActive(aura::Window* window) { |
| 572 return Shell::Get()->activation_client()->GetActiveWindow() == window; | 572 return Shell::Get()->activation_client()->GetActiveWindow() == window; |
| 573 } | 573 } |
| 574 | 574 |
| 575 void WindowManager::OnWmDeactivateWindow(aura::Window* window) { | 575 void WindowManager::OnWmDeactivateWindow(aura::Window* window) { |
| 576 Shell::Get()->activation_client()->DeactivateWindow(window); | 576 Shell::Get()->activation_client()->DeactivateWindow(window); |
| 577 } | 577 } |
| 578 | 578 |
| 579 } // namespace mus | 579 } // namespace mus |
| 580 } // namespace ash | 580 } // namespace ash |
| OLD | NEW |