Chromium Code Reviews| 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 41fae51d0cd437f48bd734da3222b013234314af..e93eee2bc8701e149f29ca54084207855e05226a 100644 |
| --- a/ash/wm/workspace/workspace_layout_manager.cc |
| +++ b/ash/wm/workspace/workspace_layout_manager.cc |
| @@ -156,6 +156,26 @@ void WorkspaceLayoutManager::OnDisplayWorkAreaInsetsChanged() { |
| ////////////////////////////////////////////////////////////////////////////// |
| // WorkspaceLayoutManager, aura::WindowObserver implementation: |
| +void WorkspaceLayoutManager::OnWindowHierarchyChanged( |
| + const WindowObserver::HierarchyChangeParams& params) { |
|
oshima
2014/02/21 19:49:46
A display may become fullscreen when the fullscree
flackr
2014/02/24 16:21:10
Yes, if an active window (i.e. panel) is preventin
|
| + 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) { |
| @@ -190,13 +210,14 @@ void WorkspaceLayoutManager::OnWindowBoundsChanged(aura::Window* window, |
| // aura::client::ActivationChangeObserver implementation: |
| void WorkspaceLayoutManager::OnWindowActivated(aura::Window* gained_active, |
| - aura::Window* lost_active) { |
| + aura::Window* lost_active) { |
| wm::WindowState* window_state = wm::GetWindowState(gained_active); |
| if (window_state && window_state->IsMinimized() && |
| !gained_active->IsVisible()) { |
| window_state->Unminimize(); |
| DCHECK(!window_state->IsMinimized()); |
| } |
| + UpdateFullscreenState(); |
| } |
| ////////////////////////////////////////////////////////////////////////////// |
| @@ -316,6 +337,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_) { |