| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/root_window_controller.h" | 5 #include "ash/root_window_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <queue> | 8 #include <queue> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 void RootWindowController::CreateForSecondaryDisplay(AshWindowTreeHost* host) { | 304 void RootWindowController::CreateForSecondaryDisplay(AshWindowTreeHost* host) { |
| 305 RootWindowController* controller = new RootWindowController(host, nullptr); | 305 RootWindowController* controller = new RootWindowController(host, nullptr); |
| 306 controller->Init(RootWindowType::SECONDARY); | 306 controller->Init(RootWindowType::SECONDARY); |
| 307 } | 307 } |
| 308 | 308 |
| 309 // static | 309 // static |
| 310 RootWindowController* RootWindowController::ForWindow( | 310 RootWindowController* RootWindowController::ForWindow( |
| 311 const aura::Window* window) { | 311 const aura::Window* window) { |
| 312 DCHECK(window); | 312 DCHECK(window); |
| 313 CHECK(Shell::HasInstance()); | 313 CHECK(Shell::HasInstance()); |
| 314 return GetRootWindowController(window->GetRootWindow()); | 314 return GetRootWindowSettings(window->GetRootWindow())->controller; |
| 315 } | 315 } |
| 316 | 316 |
| 317 // static | 317 // static |
| 318 RootWindowController* RootWindowController::ForTargetRootWindow() { | 318 RootWindowController* RootWindowController::ForTargetRootWindow() { |
| 319 CHECK(Shell::HasInstance()); | 319 CHECK(Shell::HasInstance()); |
| 320 return GetRootWindowController(Shell::GetRootWindowForNewWindows()); | 320 return ForWindow(Shell::GetRootWindowForNewWindows()); |
| 321 } | 321 } |
| 322 | 322 |
| 323 void RootWindowController::ConfigureWidgetInitParamsForContainer( | 323 void RootWindowController::ConfigureWidgetInitParamsForContainer( |
| 324 views::Widget* widget, | 324 views::Widget* widget, |
| 325 int shell_container_id, | 325 int shell_container_id, |
| 326 views::Widget::InitParams* init_params) { | 326 views::Widget::InitParams* init_params) { |
| 327 init_params->parent = GetContainer(shell_container_id); | 327 init_params->parent = GetContainer(shell_container_id); |
| 328 } | 328 } |
| 329 | 329 |
| 330 aura::WindowTreeHost* RootWindowController::GetHost() { | 330 aura::WindowTreeHost* RootWindowController::GetHost() { |
| (...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1066 shelf_->UpdateVisibilityState(); | 1066 shelf_->UpdateVisibilityState(); |
| 1067 } | 1067 } |
| 1068 | 1068 |
| 1069 void RootWindowController::OnTouchHudProjectionToggled(bool enabled) { | 1069 void RootWindowController::OnTouchHudProjectionToggled(bool enabled) { |
| 1070 if (enabled) | 1070 if (enabled) |
| 1071 EnableTouchHudProjection(); | 1071 EnableTouchHudProjection(); |
| 1072 else | 1072 else |
| 1073 DisableTouchHudProjection(); | 1073 DisableTouchHudProjection(); |
| 1074 } | 1074 } |
| 1075 | 1075 |
| 1076 RootWindowController* GetRootWindowController(const aura::Window* root_window) { | |
| 1077 return root_window ? GetRootWindowSettings(root_window)->controller : nullptr; | |
| 1078 } | |
| 1079 | |
| 1080 } // namespace ash | 1076 } // namespace ash |
| OLD | NEW |