Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(601)

Unified Diff: ash/root_window_controller.cc

Issue 149493008: Use active window if on current workspace for fullscreen mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with master. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/root_window_controller.h ('k') | ash/root_window_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/root_window_controller.cc
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc
index 6b813f8a72e96419c8cb001e2fa59c685dbf0ecc..e0d44061616f7ab515eb8199239e80062ce118f9 100644
--- a/ash/root_window_controller.cc
+++ b/ash/root_window_controller.cc
@@ -24,6 +24,7 @@
#include "ash/shell_delegate.h"
#include "ash/shell_factory.h"
#include "ash/shell_window_ids.h"
+#include "ash/switchable_windows.h"
#include "ash/system/status_area_widget.h"
#include "ash/system/tray/system_tray_delegate.h"
#include "ash/touch/touch_hud_debug.h"
@@ -570,16 +571,29 @@ void RootWindowController::UpdateShelfVisibility() {
}
const aura::Window* RootWindowController::GetWindowForFullscreenMode() const {
- const aura::Window::Windows& windows =
- GetContainer(kShellWindowId_DefaultContainer)->children();
const aura::Window* topmost_window = NULL;
- for (aura::Window::Windows::const_reverse_iterator iter = windows.rbegin();
- iter != windows.rend(); ++iter) {
- if (((*iter)->type() == ui::wm::WINDOW_TYPE_NORMAL ||
- (*iter)->type() == ui::wm::WINDOW_TYPE_PANEL) &&
- (*iter)->layer()->GetTargetVisibility()) {
- topmost_window = *iter;
- break;
+ const aura::Window* active_window = wm::GetActiveWindow();
+ if (active_window && active_window->GetRootWindow() == root_window() &&
+ IsSwitchableContainer(active_window->parent())) {
+ // Use the active window when it is on the current root window to determine
+ // the fullscreen state to allow temporarily using a panel or docked window
+ // (which are always above the default container) while a fullscreen
+ // window is open. We only use the active window when in a switchable
+ // container as the launcher should not exit fullscreen mode.
+ topmost_window = active_window;
+ } else {
+ // Otherwise, use the topmost window on the root window's default container
+ // when there is no active window on this root window.
+ const aura::Window::Windows& windows =
+ GetContainer(kShellWindowId_DefaultContainer)->children();
+ for (aura::Window::Windows::const_reverse_iterator iter = windows.rbegin();
+ iter != windows.rend(); ++iter) {
+ if (((*iter)->type() == ui::wm::WINDOW_TYPE_NORMAL ||
+ (*iter)->type() == ui::wm::WINDOW_TYPE_PANEL) &&
+ (*iter)->layer()->GetTargetVisibility()) {
+ topmost_window = *iter;
+ break;
+ }
}
}
while (topmost_window) {
« no previous file with comments | « ash/root_window_controller.h ('k') | ash/root_window_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698