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

Unified Diff: ash/aura/wm_shelf_aura.h

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/aura/wm_root_window_controller_aura.cc ('k') | ash/aura/wm_shelf_aura.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/aura/wm_shelf_aura.h
diff --git a/ash/aura/wm_shelf_aura.h b/ash/aura/wm_shelf_aura.h
index 31dfbcb3b66e3de710e46adab15b3a4c4160680f..641a2caf3d5e1ed67b01e30639b221ae6ba27892 100644
--- a/ash/aura/wm_shelf_aura.h
+++ b/ash/aura/wm_shelf_aura.h
@@ -22,12 +22,21 @@ class ASH_EXPORT WmShelfAura : public WmShelf,
public ShelfLayoutManagerObserver,
public ShelfIconObserver {
public:
- explicit WmShelfAura(Shelf* shelf);
+ WmShelfAura();
~WmShelfAura() override;
+ // This object is initialized in multiple steps as the RootWindowController
+ // constructs the components of the shelf.
+ void SetShelfLayoutManager(ShelfLayoutManager* shelf_layout_manager);
+ void SetShelf(Shelf* shelf);
+
+ void Shutdown();
+
static Shelf* GetShelf(WmShelf* shelf);
private:
+ void ResetShelfLayoutManager();
+
// WmShelf:
WmWindow* GetWindow() override;
ShelfAlignment GetAlignment() const override;
@@ -48,11 +57,13 @@ class ASH_EXPORT WmShelfAura : public WmShelf,
// ShelfIconObserver:
void OnShelfIconPositionsChanged() override;
- Shelf* shelf_;
+ // May be null during login.
+ Shelf* shelf_ = nullptr;
+
+ // Cached separately because it may be destroyed before |shelf_|.
+ ShelfLayoutManager* shelf_layout_manager_ = nullptr;
+
base::ObserverList<WmShelfObserver> observers_;
- // ShelfLayoutManager is cached separately as it may be destroyed before
- // WmShelfAura.
- ShelfLayoutManager* shelf_layout_manager_;
DISALLOW_COPY_AND_ASSIGN(WmShelfAura);
};
« no previous file with comments | « ash/aura/wm_root_window_controller_aura.cc ('k') | ash/aura/wm_shelf_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698