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

Unified Diff: ash/common/wm/workspace/workspace_layout_manager.cc

Issue 2295003002: mash: Remove WmRootWindowControllerObserver. (Closed)
Patch Set: Address comments. Created 4 years, 4 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/common/wm/workspace/workspace_layout_manager.h ('k') | ash/common/wm_root_window_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..0f5ed64b4daed6f8d9c358be9e7489aa665581fb 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,24 @@ void WorkspaceLayoutManager::OnPostWindowStateTypeChange(
}
//////////////////////////////////////////////////////////////////////////////
+// WorkspaceLayoutManager, display::DisplayObserver implementation:
+
+void WorkspaceLayoutManager::OnDisplayMetricsChanged(
+ const display::Display& display,
+ uint32_t changed_metrics) {
+ if (window_->GetDisplayNearestWindow().id() != display.id())
+ return;
+
+ 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, ShellObserver implementation:
void WorkspaceLayoutManager::OnFullscreenStateChanged(bool is_fullscreen,
« no previous file with comments | « ash/common/wm/workspace/workspace_layout_manager.h ('k') | ash/common/wm_root_window_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698