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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 #include "ash/wm/root_window_layout_manager.h" | 48 #include "ash/wm/root_window_layout_manager.h" |
49 #include "ash/wm/stacking_controller.h" | 49 #include "ash/wm/stacking_controller.h" |
50 #include "ash/wm/switchable_windows.h" | 50 #include "ash/wm/switchable_windows.h" |
51 #include "ash/wm/system_modal_container_layout_manager.h" | 51 #include "ash/wm/system_modal_container_layout_manager.h" |
52 #include "ash/wm/system_wallpaper_controller.h" | 52 #include "ash/wm/system_wallpaper_controller.h" |
53 #include "ash/wm/window_properties.h" | 53 #include "ash/wm/window_properties.h" |
54 #include "ash/wm/window_state.h" | 54 #include "ash/wm/window_state.h" |
55 #include "ash/wm/window_util.h" | 55 #include "ash/wm/window_util.h" |
56 #include "ash/wm/workspace/workspace_layout_manager.h" | 56 #include "ash/wm/workspace/workspace_layout_manager.h" |
57 #include "ash/wm/workspace_controller.h" | 57 #include "ash/wm/workspace_controller.h" |
58 #include "ash/wm_window.h" | |
59 #include "base/command_line.h" | 58 #include "base/command_line.h" |
60 #include "base/macros.h" | 59 #include "base/macros.h" |
61 #include "base/memory/ptr_util.h" | 60 #include "base/memory/ptr_util.h" |
62 #include "base/time/time.h" | 61 #include "base/time/time.h" |
63 #include "chromeos/chromeos_switches.h" | 62 #include "chromeos/chromeos_switches.h" |
64 #include "ui/aura/client/aura_constants.h" | 63 #include "ui/aura/client/aura_constants.h" |
65 #include "ui/aura/client/drag_drop_client.h" | 64 #include "ui/aura/client/drag_drop_client.h" |
66 #include "ui/aura/client/screen_position_client.h" | 65 #include "ui/aura/client/screen_position_client.h" |
67 #include "ui/aura/client/window_types.h" | 66 #include "ui/aura/client/window_types.h" |
68 #include "ui/aura/mus/window_mus.h" | 67 #include "ui/aura/mus/window_mus.h" |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 } | 336 } |
338 | 337 |
339 aura::Window* RootWindowController::GetRootWindow() { | 338 aura::Window* RootWindowController::GetRootWindow() { |
340 return GetHost()->window(); | 339 return GetHost()->window(); |
341 } | 340 } |
342 | 341 |
343 const aura::Window* RootWindowController::GetRootWindow() const { | 342 const aura::Window* RootWindowController::GetRootWindow() const { |
344 return GetHost()->window(); | 343 return GetHost()->window(); |
345 } | 344 } |
346 | 345 |
347 const WmWindow* RootWindowController::GetWindow() const { | |
348 return WmWindow::Get(GetRootWindow()); | |
349 } | |
350 | |
351 wm::WorkspaceWindowState RootWindowController::GetWorkspaceWindowState() { | 346 wm::WorkspaceWindowState RootWindowController::GetWorkspaceWindowState() { |
352 return workspace_controller_ ? workspace_controller()->GetWindowState() | 347 return workspace_controller_ ? workspace_controller()->GetWindowState() |
353 : wm::WORKSPACE_WINDOW_STATE_DEFAULT; | 348 : wm::WORKSPACE_WINDOW_STATE_DEFAULT; |
354 } | 349 } |
355 | 350 |
356 void RootWindowController::InitializeShelf() { | 351 void RootWindowController::InitializeShelf() { |
357 if (shelf_initialized_) | 352 if (shelf_initialized_) |
358 return; | 353 return; |
359 shelf_initialized_ = true; | 354 shelf_initialized_ = true; |
360 shelf_->NotifyShelfInitialized(); | 355 shelf_->NotifyShelfInitialized(); |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 } | 470 } |
476 | 471 |
477 aura::Window* RootWindowController::GetContainer(int container_id) { | 472 aura::Window* RootWindowController::GetContainer(int container_id) { |
478 return GetRootWindow()->GetChildById(container_id); | 473 return GetRootWindow()->GetChildById(container_id); |
479 } | 474 } |
480 | 475 |
481 const aura::Window* RootWindowController::GetContainer(int container_id) const { | 476 const aura::Window* RootWindowController::GetContainer(int container_id) const { |
482 return window_tree_host_->window()->GetChildById(container_id); | 477 return window_tree_host_->window()->GetChildById(container_id); |
483 } | 478 } |
484 | 479 |
485 const WmWindow* RootWindowController::GetWmContainer(int container_id) const { | |
486 const aura::Window* window = GetContainer(container_id); | |
487 return WmWindow::Get(window); | |
488 } | |
489 | |
490 void RootWindowController::SetWallpaperWidgetController( | 480 void RootWindowController::SetWallpaperWidgetController( |
491 WallpaperWidgetController* controller) { | 481 WallpaperWidgetController* controller) { |
492 wallpaper_widget_controller_.reset(controller); | 482 wallpaper_widget_controller_.reset(controller); |
493 } | 483 } |
494 | 484 |
495 void RootWindowController::SetAnimatingWallpaperWidgetController( | 485 void RootWindowController::SetAnimatingWallpaperWidgetController( |
496 AnimatingWallpaperWidgetController* controller) { | 486 AnimatingWallpaperWidgetController* controller) { |
497 if (animating_wallpaper_widget_controller_.get()) | 487 if (animating_wallpaper_widget_controller_.get()) |
498 animating_wallpaper_widget_controller_->StopAnimating(); | 488 animating_wallpaper_widget_controller_->StopAnimating(); |
499 animating_wallpaper_widget_controller_.reset(controller); | 489 animating_wallpaper_widget_controller_.reset(controller); |
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1081 EnableTouchHudProjection(); | 1071 EnableTouchHudProjection(); |
1082 else | 1072 else |
1083 DisableTouchHudProjection(); | 1073 DisableTouchHudProjection(); |
1084 } | 1074 } |
1085 | 1075 |
1086 RootWindowController* GetRootWindowController(const aura::Window* root_window) { | 1076 RootWindowController* GetRootWindowController(const aura::Window* root_window) { |
1087 return root_window ? GetRootWindowSettings(root_window)->controller : nullptr; | 1077 return root_window ? GetRootWindowSettings(root_window)->controller : nullptr; |
1088 } | 1078 } |
1089 | 1079 |
1090 } // namespace ash | 1080 } // namespace ash |
OLD | NEW |