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

Unified Diff: ash/wm/workspace/workspace_layout_manager.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: Update fullscreen state tracking in workspace and only consider switchable containers for active no… 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/wm/workspace/workspace_layout_manager.cc
diff --git a/ash/wm/workspace/workspace_layout_manager.cc b/ash/wm/workspace/workspace_layout_manager.cc
index 4e79c6e83d114f84213addf40e982c06bb4bbf6b..d717cdcde544b98ce815aa46130a4eed4a73951b 100644
--- a/ash/wm/workspace/workspace_layout_manager.cc
+++ b/ash/wm/workspace/workspace_layout_manager.cc
@@ -218,7 +218,6 @@ void WorkspaceLayoutManager::OnWindowPropertyChanged(Window* window,
void WorkspaceLayoutManager::OnWindowStackingChanged(aura::Window* window) {
UpdateShelfVisibility();
- UpdateFullscreenState();
oshima 2014/02/14 20:09:30 I think this one should stay here. Technically it'
flackr 2014/02/14 20:15:01 Correct, but this calls OnWindowRemovedFromLayout
}
void WorkspaceLayoutManager::OnWindowDestroying(aura::Window* window) {
@@ -247,6 +246,7 @@ void WorkspaceLayoutManager::OnWindowActivated(aura::Window* gained_active,
window_state->Unminimize();
DCHECK(!window_state->IsMinimized());
}
+ UpdateFullscreenState();
oshima 2014/02/14 17:24:26 All layout managers are notified for activation ch
flackr 2014/02/14 20:00:02 Yes, since it's a ShellObserver notification, that
}
//////////////////////////////////////////////////////////////////////////////
@@ -425,8 +425,16 @@ void WorkspaceLayoutManager::UpdateShelfVisibility() {
}
void WorkspaceLayoutManager::UpdateFullscreenState() {
- bool is_fullscreen = GetRootWindowController(
- window_->GetRootWindow())->GetWindowForFullscreenMode() != NULL;
+ const aura::Window* fullscreen_window = GetRootWindowController(
+ window_->GetRootWindow())->GetWindowForFullscreenMode();
+ // TODO(flackr): The fullscreen state is currently tracked per workspace
+ // but the shell notification implies a per root window state. Currently
+ // only windows in the default workspace container will go fullscreen so
+ // this should correctly track the root window fullscreen state but this
+ // should really be tracked by the RootWindowController since technically
+ // any container could get a fullscreen window.
+ bool is_fullscreen = fullscreen_window &&
+ window_->Contains(fullscreen_window);
if (is_fullscreen != is_fullscreen_) {
ash::Shell::GetInstance()->NotifyFullscreenStateChange(
is_fullscreen, window_->GetRootWindow());
« ash/shelf/shelf_layout_manager_unittest.cc ('K') | « ash/wm/overview/window_selector_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698