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 13 matching lines...) Expand all Loading... |
24 #include "ash/shell_delegate.h" | 24 #include "ash/shell_delegate.h" |
25 #include "ash/shell_factory.h" | 25 #include "ash/shell_factory.h" |
26 #include "ash/shell_window_ids.h" | 26 #include "ash/shell_window_ids.h" |
27 #include "ash/system/status_area_widget.h" | 27 #include "ash/system/status_area_widget.h" |
28 #include "ash/system/tray/system_tray_delegate.h" | 28 #include "ash/system/tray/system_tray_delegate.h" |
29 #include "ash/touch/touch_hud_debug.h" | 29 #include "ash/touch/touch_hud_debug.h" |
30 #include "ash/touch/touch_hud_projection.h" | 30 #include "ash/touch/touch_hud_projection.h" |
31 #include "ash/touch/touch_observer_hud.h" | 31 #include "ash/touch/touch_observer_hud.h" |
32 #include "ash/wm/always_on_top_controller.h" | 32 #include "ash/wm/always_on_top_controller.h" |
33 #include "ash/wm/dock/docked_window_layout_manager.h" | 33 #include "ash/wm/dock/docked_window_layout_manager.h" |
| 34 #include "ash/wm/mru_window_tracker.h" |
34 #include "ash/wm/panels/panel_layout_manager.h" | 35 #include "ash/wm/panels/panel_layout_manager.h" |
35 #include "ash/wm/panels/panel_window_event_handler.h" | 36 #include "ash/wm/panels/panel_window_event_handler.h" |
36 #include "ash/wm/root_window_layout_manager.h" | 37 #include "ash/wm/root_window_layout_manager.h" |
37 #include "ash/wm/screen_dimmer.h" | 38 #include "ash/wm/screen_dimmer.h" |
38 #include "ash/wm/stacking_controller.h" | 39 #include "ash/wm/stacking_controller.h" |
39 #include "ash/wm/status_area_layout_manager.h" | 40 #include "ash/wm/status_area_layout_manager.h" |
40 #include "ash/wm/system_background_controller.h" | 41 #include "ash/wm/system_background_controller.h" |
41 #include "ash/wm/system_modal_container_layout_manager.h" | 42 #include "ash/wm/system_modal_container_layout_manager.h" |
42 #include "ash/wm/window_properties.h" | 43 #include "ash/wm/window_properties.h" |
43 #include "ash/wm/window_state.h" | 44 #include "ash/wm/window_state.h" |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 } | 563 } |
563 | 564 |
564 Shell::GetInstance()->UpdateShelfVisibility(); | 565 Shell::GetInstance()->UpdateShelfVisibility(); |
565 } | 566 } |
566 | 567 |
567 void RootWindowController::UpdateShelfVisibility() { | 568 void RootWindowController::UpdateShelfVisibility() { |
568 shelf_->shelf_layout_manager()->UpdateVisibilityState(); | 569 shelf_->shelf_layout_manager()->UpdateVisibilityState(); |
569 } | 570 } |
570 | 571 |
571 const aura::Window* RootWindowController::GetWindowForFullscreenMode() const { | 572 const aura::Window* RootWindowController::GetWindowForFullscreenMode() const { |
572 const aura::Window::Windows& windows = | |
573 GetContainer(kShellWindowId_DefaultContainer)->children(); | |
574 const aura::Window* topmost_window = NULL; | 573 const aura::Window* topmost_window = NULL; |
575 for (aura::Window::Windows::const_reverse_iterator iter = windows.rbegin(); | 574 if (Shell::GetInstance()->mru_window_tracker()) { |
576 iter != windows.rend(); ++iter) { | 575 topmost_window = Shell::GetInstance()->mru_window_tracker()-> |
577 if (((*iter)->type() == ui::wm::WINDOW_TYPE_NORMAL || | 576 GetMruWindowInRoot(root_window()); |
578 (*iter)->type() == ui::wm::WINDOW_TYPE_PANEL) && | |
579 (*iter)->layer()->GetTargetVisibility()) { | |
580 topmost_window = *iter; | |
581 break; | |
582 } | |
583 } | 577 } |
| 578 |
| 579 // If any transient parent of the active window is fullscreen the root |
| 580 // window should remain in fullscreen mode. |
584 while (topmost_window) { | 581 while (topmost_window) { |
585 if (wm::GetWindowState(topmost_window)->IsFullscreen()) | 582 if (wm::GetWindowState(topmost_window)->IsFullscreen()) |
586 return topmost_window; | 583 return topmost_window; |
587 topmost_window = views::corewm::GetTransientParent(topmost_window); | 584 topmost_window = views::corewm::GetTransientParent(topmost_window); |
588 } | 585 } |
589 return NULL; | 586 return NULL; |
590 } | 587 } |
591 | 588 |
592 void RootWindowController::ActivateKeyboard( | 589 void RootWindowController::ActivateKeyboard( |
593 keyboard::KeyboardController* keyboard_controller) { | 590 keyboard::KeyboardController* keyboard_controller) { |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
976 DisableTouchHudProjection(); | 973 DisableTouchHudProjection(); |
977 } | 974 } |
978 | 975 |
979 RootWindowController* GetRootWindowController( | 976 RootWindowController* GetRootWindowController( |
980 const aura::Window* root_window) { | 977 const aura::Window* root_window) { |
981 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; | 978 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; |
982 } | 979 } |
983 | 980 |
984 } // namespace internal | 981 } // namespace internal |
985 } // namespace ash | 982 } // namespace ash |
OLD | NEW |