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

Unified Diff: ash/shelf/shelf_layout_manager.cc

Issue 1916913007: mus/ash: WmRootWindowController can be null in mus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_layout_manager.cc
diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc
index efb1a9349bd1d251c08d31fe361ec2314758efe3..77f819032596f8fc73b447148e95b88cf5b8d312 100644
--- a/ash/shelf/shelf_layout_manager.cc
+++ b/ash/shelf/shelf_layout_manager.cc
@@ -229,13 +229,16 @@ ShelfLayoutManager::ShelfLayoutManager(ShelfWidget* shelf)
gesture_drag_auto_hide_state_(SHELF_AUTO_HIDE_SHOWN),
update_shelf_observer_(NULL),
chromevox_panel_height_(0),
- duration_override_in_ms_(0),
- root_window_controller_observer_(
- new RootWindowControllerObserverImpl(this)) {
+ duration_override_in_ms_(0) {
Shell::GetInstance()->AddShellObserver(this);
- wm::WmWindowAura::Get(root_window_)
- ->GetRootWindowController()
- ->AddObserver(root_window_controller_observer_.get());
+
+ if (!Shell::GetInstance()->in_mus()) {
+ root_window_controller_observer_.reset(
+ new RootWindowControllerObserverImpl(this));
+ wm::WmWindowAura::Get(root_window_)
+ ->GetRootWindowController()
+ ->AddObserver(root_window_controller_observer_.get());
+ }
Shell::GetInstance()->lock_state_controller()->AddObserver(this);
aura::client::GetActivationClient(root_window_)->AddObserver(this);
Shell::GetInstance()->session_state_delegate()->AddSessionStateObserver(this);
@@ -250,9 +253,11 @@ ShelfLayoutManager::~ShelfLayoutManager() {
Shell::GetInstance()->lock_state_controller()->RemoveObserver(this);
Shell::GetInstance()->
session_state_delegate()->RemoveSessionStateObserver(this);
- wm::WmWindowAura::Get(root_window_)
- ->GetRootWindowController()
- ->RemoveObserver(root_window_controller_observer_.get());
+ if (root_window_controller_observer_) {
+ wm::WmWindowAura::Get(root_window_)
+ ->GetRootWindowController()
+ ->RemoveObserver(root_window_controller_observer_.get());
+ }
}
void ShelfLayoutManager::PrepareForShutdown() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698