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

Unified Diff: ash/wm/aura/wm_root_window_controller_aura.cc

Issue 1911833002: Converts DockedWindowLayoutManager to use WmRootWindowControllerObserver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge 2 trunk Created 4 years, 8 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/aura/wm_root_window_controller_aura.h ('k') | ash/wm/aura/wm_window_aura.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/aura/wm_root_window_controller_aura.cc
diff --git a/ash/wm/aura/wm_root_window_controller_aura.cc b/ash/wm/aura/wm_root_window_controller_aura.cc
index 306827981749375f352404c4ee3b7f255dda2c14..8f099b5d96090775cb3a695a5e58fa3c84430116 100644
--- a/ash/wm/aura/wm_root_window_controller_aura.cc
+++ b/ash/wm/aura/wm_root_window_controller_aura.cc
@@ -9,6 +9,7 @@
#include "ash/shell.h"
#include "ash/wm/aura/wm_globals_aura.h"
#include "ash/wm/aura/wm_window_aura.h"
+#include "ash/wm/common/wm_root_window_controller_observer.h"
#include "ash/wm/workspace_controller.h"
#include "ui/aura/window.h"
#include "ui/aura/window_property.h"
@@ -35,9 +36,12 @@ WmRootWindowControllerAura::WmRootWindowControllerAura(
: root_window_controller_(root_window_controller) {
root_window_controller_->GetRootWindow()->SetProperty(
kWmRootWindowControllerKey, this);
+ Shell::GetInstance()->AddShellObserver(this);
}
-WmRootWindowControllerAura::~WmRootWindowControllerAura() {}
+WmRootWindowControllerAura::~WmRootWindowControllerAura() {
+ Shell::GetInstance()->RemoveShellObserver(this);
+}
// static
const WmRootWindowControllerAura* WmRootWindowControllerAura::Get(
@@ -83,5 +87,40 @@ void WmRootWindowControllerAura::ConfigureWidgetInitParamsForContainer(
init_params->parent = Shell::GetContainer(
root_window_controller_->GetRootWindow(), shell_container_id);
}
+
+void WmRootWindowControllerAura::AddObserver(
+ WmRootWindowControllerObserver* observer) {
+ observers_.AddObserver(observer);
+}
+
+void WmRootWindowControllerAura::RemoveObserver(
+ WmRootWindowControllerObserver* observer) {
+ observers_.RemoveObserver(observer);
+}
+
+void WmRootWindowControllerAura::OnDisplayWorkAreaInsetsChanged() {
+ FOR_EACH_OBSERVER(WmRootWindowControllerObserver, observers_,
+ OnWorkAreaChanged());
+}
+
+void WmRootWindowControllerAura::OnFullscreenStateChanged(
+ bool is_fullscreen,
+ aura::Window* root_window) {
+ if (root_window != root_window_controller_->GetRootWindow())
+ return;
+
+ FOR_EACH_OBSERVER(WmRootWindowControllerObserver, observers_,
+ OnFullscreenStateChanged(is_fullscreen));
+}
+
+void WmRootWindowControllerAura::OnShelfAlignmentChanged(
+ aura::Window* root_window) {
+ if (root_window != root_window_controller_->GetRootWindow())
+ return;
+
+ FOR_EACH_OBSERVER(WmRootWindowControllerObserver, observers_,
+ OnShelfAlignmentChanged());
+}
+
} // namespace wm
} // namespace ash
« no previous file with comments | « ash/wm/aura/wm_root_window_controller_aura.h ('k') | ash/wm/aura/wm_window_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698