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

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 and add review suggestions. 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
Index: ash/root_window_controller.cc
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc
index 51bd3ade55cca0943059cff0cb2f192a27d0d888..4d521cfe0f91c387576915a4ee862a5f96adcda2 100644
--- a/ash/root_window_controller.cc
+++ b/ash/root_window_controller.cc
@@ -570,16 +570,27 @@ 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()) {
+ // 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.
+ 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) {

Powered by Google App Engine
This is Rietveld 408576698