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

Unified Diff: ash/shelf/shelf_widget.cc

Issue 2041583004: mash: Move WmShelfAura ownership to RootWindowController and init it earlier (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@moveshelftypes
Patch Set: . Created 4 years, 6 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/shelf/shelf_widget.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_widget.cc
diff --git a/ash/shelf/shelf_widget.cc b/ash/shelf/shelf_widget.cc
index 8ec003f9138d8682e9c956234fa060788d8a4591..2a5e317c7a3035a3fe47e904edd07c8da4c1f369 100644
--- a/ash/shelf/shelf_widget.cc
+++ b/ash/shelf/shelf_widget.cc
@@ -5,6 +5,7 @@
#include "ash/shelf/shelf_widget.h"
#include "ash/ash_switches.h"
+#include "ash/aura/wm_shelf_aura.h"
#include "ash/aura/wm_window_aura.h"
#include "ash/common/shelf/shelf_constants.h"
#include "ash/common/shelf/wm_shelf_util.h"
@@ -715,12 +716,15 @@ bool ShelfWidget::GetDimsShelf() const {
return delegate_view_->GetDimmed();
}
-void ShelfWidget::CreateShelf() {
+void ShelfWidget::CreateShelf(WmShelfAura* wm_shelf_aura) {
DCHECK(!shelf_);
Shell* shell = Shell::GetInstance();
ShelfDelegate* delegate = shell->GetShelfDelegate();
shelf_.reset(new Shelf(shell->shelf_model(), delegate, this));
+ // Must be initialized before the delegate is notified because the delegate
+ // may try to access the WmShelf.
+ wm_shelf_aura->SetShelf(shelf_.get());
delegate->OnShelfCreated(shelf_.get());
SetFocusCycler(shell->focus_cycler());
« no previous file with comments | « ash/shelf/shelf_widget.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698