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 14 matching lines...) Expand all Loading... |
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/base_layout_manager.h" | 33 #include "ash/wm/base_layout_manager.h" |
34 #include "ash/wm/dock/docked_window_layout_manager.h" | 34 #include "ash/wm/dock/docked_window_layout_manager.h" |
| 35 #include "ash/wm/mru_window_tracker.h" |
35 #include "ash/wm/panels/panel_layout_manager.h" | 36 #include "ash/wm/panels/panel_layout_manager.h" |
36 #include "ash/wm/panels/panel_window_event_handler.h" | 37 #include "ash/wm/panels/panel_window_event_handler.h" |
37 #include "ash/wm/root_window_layout_manager.h" | 38 #include "ash/wm/root_window_layout_manager.h" |
38 #include "ash/wm/screen_dimmer.h" | 39 #include "ash/wm/screen_dimmer.h" |
39 #include "ash/wm/stacking_controller.h" | 40 #include "ash/wm/stacking_controller.h" |
40 #include "ash/wm/status_area_layout_manager.h" | 41 #include "ash/wm/status_area_layout_manager.h" |
41 #include "ash/wm/system_background_controller.h" | 42 #include "ash/wm/system_background_controller.h" |
42 #include "ash/wm/system_modal_container_layout_manager.h" | 43 #include "ash/wm/system_modal_container_layout_manager.h" |
43 #include "ash/wm/window_properties.h" | 44 #include "ash/wm/window_properties.h" |
44 #include "ash/wm/window_state.h" | 45 #include "ash/wm/window_state.h" |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 } | 564 } |
564 | 565 |
565 Shell::GetInstance()->UpdateShelfVisibility(); | 566 Shell::GetInstance()->UpdateShelfVisibility(); |
566 } | 567 } |
567 | 568 |
568 void RootWindowController::UpdateShelfVisibility() { | 569 void RootWindowController::UpdateShelfVisibility() { |
569 shelf_->shelf_layout_manager()->UpdateVisibilityState(); | 570 shelf_->shelf_layout_manager()->UpdateVisibilityState(); |
570 } | 571 } |
571 | 572 |
572 const aura::Window* RootWindowController::GetWindowForFullscreenMode() const { | 573 const aura::Window* RootWindowController::GetWindowForFullscreenMode() const { |
573 const aura::Window::Windows& windows = | |
574 GetContainer(kShellWindowId_DefaultContainer)->children(); | |
575 const aura::Window* topmost_window = NULL; | 574 const aura::Window* topmost_window = NULL; |
576 for (aura::Window::Windows::const_reverse_iterator iter = windows.rbegin(); | 575 // If the active window is on the current root window, prefer to use that as |
577 iter != windows.rend(); ++iter) { | 576 // the most recently used window list does not include windows from all |
578 if (((*iter)->type() == ui::wm::WINDOW_TYPE_NORMAL || | 577 // containers such as the laucher. |
579 (*iter)->type() == ui::wm::WINDOW_TYPE_PANEL) && | 578 const aura::Window* active_window = ash::wm::GetActiveWindow(); |
580 (*iter)->layer()->GetTargetVisibility()) { | 579 if (active_window && active_window->GetRootWindow() == root_window()) { |
581 topmost_window = *iter; | 580 topmost_window = active_window; |
582 break; | 581 } else if (Shell::GetInstance()->mru_window_tracker()) { |
583 } | 582 topmost_window = Shell::GetInstance()->mru_window_tracker()-> |
| 583 GetMruWindowInRoot(root_window()); |
584 } | 584 } |
| 585 |
| 586 // If any transient parent of the active window is fullscreen the root |
| 587 // window should remain in fullscreen mode. |
585 while (topmost_window) { | 588 while (topmost_window) { |
586 if (wm::GetWindowState(topmost_window)->IsFullscreen()) | 589 if (wm::GetWindowState(topmost_window)->IsFullscreen()) |
587 return topmost_window; | 590 return topmost_window; |
588 topmost_window = views::corewm::GetTransientParent(topmost_window); | 591 topmost_window = views::corewm::GetTransientParent(topmost_window); |
589 } | 592 } |
590 return NULL; | 593 return NULL; |
591 } | 594 } |
592 | 595 |
593 void RootWindowController::ActivateKeyboard( | 596 void RootWindowController::ActivateKeyboard( |
594 keyboard::KeyboardController* keyboard_controller) { | 597 keyboard::KeyboardController* keyboard_controller) { |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
977 DisableTouchHudProjection(); | 980 DisableTouchHudProjection(); |
978 } | 981 } |
979 | 982 |
980 RootWindowController* GetRootWindowController( | 983 RootWindowController* GetRootWindowController( |
981 const aura::Window* root_window) { | 984 const aura::Window* root_window) { |
982 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; | 985 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; |
983 } | 986 } |
984 | 987 |
985 } // namespace internal | 988 } // namespace internal |
986 } // namespace ash | 989 } // namespace ash |
OLD | NEW |