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

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: 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/wm/workspace/workspace_layout_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a5ca0a08b7dfbcd4204b39b0b8d4e26d203bc277..7308b336ad639176958548111b834cdd533cde5d 100644
--- a/ash/wm/workspace/workspace_layout_manager.cc
+++ b/ash/wm/workspace/workspace_layout_manager.cc
@@ -94,13 +94,11 @@ void WorkspaceLayoutManager::OnChildWindowVisibilityChanged(Window* child,
if (visible && window_state->IsMinimized())
window_state->Unminimize();
- if (child->TargetVisibility()) {
+ if (child->TargetVisibility())
WindowPositioner::RearrangeVisibleWindowOnShow(child);
- } else {
- if (wm::GetWindowState(child)->IsFullscreen())
- UpdateFullscreenState();
+ else
WindowPositioner::RearrangeVisibleWindowOnHideOrRemove(child);
- }
+ UpdateFullscreenState();
UpdateShelfVisibility();
}
@@ -126,6 +124,26 @@ void WorkspaceLayoutManager::OnDisplayWorkAreaInsetsChanged() {
//////////////////////////////////////////////////////////////////////////////
// WorkspaceLayoutManager, aura::WindowObserver implementation:
+void WorkspaceLayoutManager::OnWindowHierarchyChanged(
+ const WindowObserver::HierarchyChangeParams& params) {
+ if (!wm::GetWindowState(params.target)->IsActive())
+ return;
+ // If the window is already tracked by the workspace this update would be
+ // redundant as the fullscreen and shelf state would have been handled in
+ // OnWindowAddedToLayout.
+ if (windows_.find(params.target) != windows_.end())
+ return;
+
+ // If the active window has moved to this root window then update the
+ // fullscreen state.
+ // TODO(flackr): Track the active window leaving this root window and update
+ // the fullscreen state accordingly.
+ if (params.new_parent && params.new_parent->GetRootWindow() == root_window_) {
+ UpdateFullscreenState();
+ UpdateShelfVisibility();
+ }
+}
+
void WorkspaceLayoutManager::OnWindowPropertyChanged(Window* window,
const void* key,
intptr_t old) {
@@ -167,6 +185,8 @@ void WorkspaceLayoutManager::OnWindowActivated(aura::Window* gained_active,
window_state->Unminimize();
DCHECK(!window_state->IsMinimized());
}
+ UpdateFullscreenState();
+ UpdateShelfVisibility();
}
//////////////////////////////////////////////////////////////////////////////
@@ -220,6 +240,13 @@ void WorkspaceLayoutManager::UpdateShelfVisibility() {
}
void WorkspaceLayoutManager::UpdateFullscreenState() {
+ // 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 but
+ // this should really be tracked by the RootWindowController since
+ // technically any container could get a fullscreen window.
+ if (!shelf_)
+ return;
bool is_fullscreen = GetRootWindowController(
window_->GetRootWindow())->GetWindowForFullscreenMode() != NULL;
if (is_fullscreen != is_fullscreen_) {
« no previous file with comments | « ash/wm/workspace/workspace_layout_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698