Chromium Code Reviews| Index: ash/common/wm/workspace/workspace_layout_manager.cc |
| diff --git a/ash/common/wm/workspace/workspace_layout_manager.cc b/ash/common/wm/workspace/workspace_layout_manager.cc |
| index 61c188c0619372c586d32023d25f014b39f51989..22765c9ac153d8b52fa7093ab85ef133a3e05adf 100644 |
| --- a/ash/common/wm/workspace/workspace_layout_manager.cc |
| +++ b/ash/common/wm/workspace/workspace_layout_manager.cc |
| @@ -23,6 +23,8 @@ |
| #include "base/command_line.h" |
| #include "ui/base/ui_base_switches.h" |
| #include "ui/compositor/layer.h" |
| +#include "ui/display/display.h" |
| +#include "ui/display/screen.h" |
| #include "ui/keyboard/keyboard_controller.h" |
| #include "ui/keyboard/keyboard_controller_observer.h" |
| @@ -38,7 +40,7 @@ WorkspaceLayoutManager::WorkspaceLayoutManager(WmWindow* window) |
| shell_->AddShellObserver(this); |
| shell_->AddActivationObserver(this); |
| root_window_->AddObserver(this); |
| - root_window_controller_->AddObserver(this); |
| + display::Screen::GetScreen()->AddObserver(this); |
| DCHECK(window->GetBoolProperty( |
| WmWindowProperty::SNAP_CHILDREN_TO_PIXEL_BOUNDARY)); |
| } |
| @@ -51,7 +53,7 @@ WorkspaceLayoutManager::~WorkspaceLayoutManager() { |
| window_state->RemoveObserver(this); |
| window->RemoveObserver(this); |
| } |
| - root_window_->GetRootWindowController()->RemoveObserver(this); |
| + display::Screen::GetScreen()->RemoveObserver(this); |
| shell_->RemoveActivationObserver(this); |
| shell_->RemoveShellObserver(this); |
| } |
| @@ -174,19 +176,6 @@ void WorkspaceLayoutManager::OnKeyboardBoundsChanging( |
| } |
| ////////////////////////////////////////////////////////////////////////////// |
| -// WorkspaceLayoutManager, WmRootWindowControllerObserver implementation: |
| - |
| -void WorkspaceLayoutManager::OnWorkAreaChanged() { |
| - const gfx::Rect work_area(wm::GetDisplayWorkAreaBounds(window_)); |
| - if (work_area != work_area_in_parent_) { |
| - const wm::WMEvent event(wm::WM_EVENT_WORKAREA_BOUNDS_CHANGED); |
| - AdjustAllWindowsBoundsForWorkAreaChange(&event); |
| - } |
| - if (backdrop_delegate_) |
| - backdrop_delegate_->OnDisplayWorkAreaInsetsChanged(); |
| -} |
| - |
| -////////////////////////////////////////////////////////////////////////////// |
| // WorkspaceLayoutManager, aura::WindowObserver implementation: |
| void WorkspaceLayoutManager::OnWindowTreeChanged( |
| @@ -282,6 +271,21 @@ void WorkspaceLayoutManager::OnPostWindowStateTypeChange( |
| } |
| ////////////////////////////////////////////////////////////////////////////// |
| +// WorkspaceLayoutManager, display::DisplayObserver implementation: |
| + |
| +void WorkspaceLayoutManager::OnDisplayMetricsChanged( |
| + const display::Display& display, |
| + uint32_t changed_metrics) { |
| + const gfx::Rect work_area(wm::GetDisplayWorkAreaBounds(window_)); |
|
sky
2016/08/31 16:04:30
Similar comment here about checking ids.
msw
2016/08/31 17:07:32
Done.
|
| + if (work_area != work_area_in_parent_) { |
| + const wm::WMEvent event(wm::WM_EVENT_WORKAREA_BOUNDS_CHANGED); |
| + AdjustAllWindowsBoundsForWorkAreaChange(&event); |
| + } |
| + if (backdrop_delegate_) |
| + backdrop_delegate_->OnDisplayWorkAreaInsetsChanged(); |
| +} |
| + |
| +////////////////////////////////////////////////////////////////////////////// |
| // WorkspaceLayoutManager, ShellObserver implementation: |
| void WorkspaceLayoutManager::OnFullscreenStateChanged(bool is_fullscreen, |