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 <queue> | 7 #include <queue> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/ash_constants.h" | 10 #include "ash/ash_constants.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 #include "ash/wm/toplevel_window_event_handler.h" | 44 #include "ash/wm/toplevel_window_event_handler.h" |
45 #include "ash/wm/window_properties.h" | 45 #include "ash/wm/window_properties.h" |
46 #include "ash/wm/window_state.h" | 46 #include "ash/wm/window_state.h" |
47 #include "ash/wm/window_util.h" | 47 #include "ash/wm/window_util.h" |
48 #include "ash/wm/workspace_controller.h" | 48 #include "ash/wm/workspace_controller.h" |
49 #include "base/command_line.h" | 49 #include "base/command_line.h" |
50 #include "base/time/time.h" | 50 #include "base/time/time.h" |
51 #include "ui/aura/client/aura_constants.h" | 51 #include "ui/aura/client/aura_constants.h" |
52 #include "ui/aura/client/drag_drop_client.h" | 52 #include "ui/aura/client/drag_drop_client.h" |
53 #include "ui/aura/client/tooltip_client.h" | 53 #include "ui/aura/client/tooltip_client.h" |
54 #include "ui/aura/client/window_types.h" | |
55 #include "ui/aura/root_window.h" | 54 #include "ui/aura/root_window.h" |
56 #include "ui/aura/window.h" | 55 #include "ui/aura/window.h" |
57 #include "ui/aura/window_delegate.h" | 56 #include "ui/aura/window_delegate.h" |
58 #include "ui/aura/window_observer.h" | 57 #include "ui/aura/window_observer.h" |
59 #include "ui/aura/window_tracker.h" | 58 #include "ui/aura/window_tracker.h" |
60 #include "ui/base/hit_test.h" | 59 #include "ui/base/hit_test.h" |
61 #include "ui/base/models/menu_model.h" | 60 #include "ui/base/models/menu_model.h" |
62 #include "ui/gfx/display.h" | 61 #include "ui/gfx/display.h" |
63 #include "ui/gfx/screen.h" | 62 #include "ui/gfx/screen.h" |
64 #include "ui/keyboard/keyboard_controller.h" | 63 #include "ui/keyboard/keyboard_controller.h" |
65 #include "ui/keyboard/keyboard_util.h" | 64 #include "ui/keyboard/keyboard_util.h" |
66 #include "ui/views/controls/menu/menu_runner.h" | 65 #include "ui/views/controls/menu/menu_runner.h" |
67 #include "ui/views/corewm/capture_controller.h" | 66 #include "ui/views/corewm/capture_controller.h" |
68 #include "ui/views/corewm/visibility_controller.h" | 67 #include "ui/views/corewm/visibility_controller.h" |
69 #include "ui/views/view_model.h" | 68 #include "ui/views/view_model.h" |
70 #include "ui/views/view_model_utils.h" | 69 #include "ui/views/view_model_utils.h" |
| 70 #include "ui/wm/public/window_types.h" |
71 | 71 |
72 #if defined(OS_CHROMEOS) | 72 #if defined(OS_CHROMEOS) |
73 #include "ash/wm/boot_splash_screen_chromeos.h" | 73 #include "ash/wm/boot_splash_screen_chromeos.h" |
74 #endif | 74 #endif |
75 | 75 |
76 namespace ash { | 76 namespace ash { |
77 namespace { | 77 namespace { |
78 | 78 |
79 #if defined(OS_CHROMEOS) | 79 #if defined(OS_CHROMEOS) |
80 // Duration for the animation that hides the boot splash screen, in | 80 // Duration for the animation that hides the boot splash screen, in |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 | 281 |
282 // static | 282 // static |
283 RootWindowController* RootWindowController::ForTargetRootWindow() { | 283 RootWindowController* RootWindowController::ForTargetRootWindow() { |
284 return internal::GetRootWindowController(Shell::GetTargetRootWindow()); | 284 return internal::GetRootWindowController(Shell::GetTargetRootWindow()); |
285 } | 285 } |
286 | 286 |
287 // static | 287 // static |
288 aura::Window* RootWindowController::GetContainerForWindow( | 288 aura::Window* RootWindowController::GetContainerForWindow( |
289 aura::Window* window) { | 289 aura::Window* window) { |
290 aura::Window* container = window->parent(); | 290 aura::Window* container = window->parent(); |
291 while (container && container->type() != aura::client::WINDOW_TYPE_UNKNOWN) | 291 while (container && container->type() != ui::wm::WINDOW_TYPE_UNKNOWN) |
292 container = container->parent(); | 292 container = container->parent(); |
293 return container; | 293 return container; |
294 } | 294 } |
295 | 295 |
296 RootWindowController::~RootWindowController() { | 296 RootWindowController::~RootWindowController() { |
297 Shutdown(); | 297 Shutdown(); |
298 root_window_.reset(); | 298 root_window_.reset(); |
299 // The CaptureClient needs to be around for as long as the RootWindow is | 299 // The CaptureClient needs to be around for as long as the RootWindow is |
300 // valid. | 300 // valid. |
301 capture_client_.reset(); | 301 capture_client_.reset(); |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 void RootWindowController::UpdateShelfVisibility() { | 559 void RootWindowController::UpdateShelfVisibility() { |
560 shelf_->shelf_layout_manager()->UpdateVisibilityState(); | 560 shelf_->shelf_layout_manager()->UpdateVisibilityState(); |
561 } | 561 } |
562 | 562 |
563 const aura::Window* RootWindowController::GetWindowForFullscreenMode() const { | 563 const aura::Window* RootWindowController::GetWindowForFullscreenMode() const { |
564 const aura::Window::Windows& windows = | 564 const aura::Window::Windows& windows = |
565 GetContainer(kShellWindowId_DefaultContainer)->children(); | 565 GetContainer(kShellWindowId_DefaultContainer)->children(); |
566 const aura::Window* topmost_window = NULL; | 566 const aura::Window* topmost_window = NULL; |
567 for (aura::Window::Windows::const_reverse_iterator iter = windows.rbegin(); | 567 for (aura::Window::Windows::const_reverse_iterator iter = windows.rbegin(); |
568 iter != windows.rend(); ++iter) { | 568 iter != windows.rend(); ++iter) { |
569 if (((*iter)->type() == aura::client::WINDOW_TYPE_NORMAL || | 569 if (((*iter)->type() == ui::wm::WINDOW_TYPE_NORMAL || |
570 (*iter)->type() == aura::client::WINDOW_TYPE_PANEL) && | 570 (*iter)->type() == ui::wm::WINDOW_TYPE_PANEL) && |
571 (*iter)->layer()->GetTargetVisibility()) { | 571 (*iter)->layer()->GetTargetVisibility()) { |
572 topmost_window = *iter; | 572 topmost_window = *iter; |
573 break; | 573 break; |
574 } | 574 } |
575 } | 575 } |
576 while (topmost_window) { | 576 while (topmost_window) { |
577 if (wm::GetWindowState(topmost_window)->IsFullscreen()) | 577 if (wm::GetWindowState(topmost_window)->IsFullscreen()) |
578 return topmost_window; | 578 return topmost_window; |
579 topmost_window = topmost_window->transient_parent(); | 579 topmost_window = topmost_window->transient_parent(); |
580 } | 580 } |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
975 DisableTouchHudProjection(); | 975 DisableTouchHudProjection(); |
976 } | 976 } |
977 | 977 |
978 RootWindowController* GetRootWindowController( | 978 RootWindowController* GetRootWindowController( |
979 const aura::Window* root_window) { | 979 const aura::Window* root_window) { |
980 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; | 980 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; |
981 } | 981 } |
982 | 982 |
983 } // namespace internal | 983 } // namespace internal |
984 } // namespace ash | 984 } // namespace ash |
OLD | NEW |