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

Unified Diff: ash/shelf/shelf.cc

Issue 2177663002: mash: Move ownership of ShelfDelegate to WmShell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix wallpaper tests again Created 4 years, 5 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.h ('k') | ash/shelf/shelf_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf.cc
diff --git a/ash/shelf/shelf.cc b/ash/shelf/shelf.cc
index 2030432fc898a63173f80d4ab1bf874988448582..a557586399a669219bb74b1273aa92156dccbfd3 100644
--- a/ash/shelf/shelf.cc
+++ b/ash/shelf/shelf.cc
@@ -8,14 +8,15 @@
#include <cmath>
#include "ash/aura/wm_window_aura.h"
+#include "ash/common/shelf/shelf_delegate.h"
#include "ash/common/shelf/shelf_item_delegate.h"
#include "ash/common/shelf/shelf_model.h"
#include "ash/common/shelf/shelf_navigator.h"
#include "ash/common/shelf/wm_shelf_util.h"
#include "ash/common/shell_window_ids.h"
+#include "ash/common/wm_shell.h"
#include "ash/root_window_controller.h"
#include "ash/screen_util.h"
-#include "ash/shelf/shelf_delegate.h"
#include "ash/shelf/shelf_layout_manager.h"
#include "ash/shelf/shelf_util.h"
#include "ash/shelf/shelf_view.h"
@@ -39,13 +40,14 @@ namespace ash {
const char Shelf::kNativeViewName[] = "ShelfView";
Shelf::Shelf(ShelfModel* shelf_model,
- ShelfDelegate* shelf_delegate,
WmShelf* wm_shelf,
ShelfWidget* shelf_widget)
- : delegate_(shelf_delegate),
- wm_shelf_(wm_shelf),
+ : wm_shelf_(wm_shelf),
shelf_widget_(shelf_widget),
- shelf_view_(new ShelfView(shelf_model, delegate_, wm_shelf, this)),
+ shelf_view_(new ShelfView(shelf_model,
+ WmShell::Get()->shelf_delegate(),
+ wm_shelf,
+ this)),
shelf_locking_manager_(wm_shelf) {
DCHECK(wm_shelf_);
shelf_view_->Init();
@@ -54,7 +56,7 @@ Shelf::Shelf(ShelfModel* shelf_model,
}
Shelf::~Shelf() {
- delegate_->OnShelfDestroyed(this);
+ WmShell::Get()->shelf_delegate()->OnShelfDestroyed(this);
}
// static
@@ -82,7 +84,7 @@ void Shelf::SetAlignment(ShelfAlignment alignment) {
alignment_ = alignment;
shelf_view_->OnShelfAlignmentChanged();
shelf_widget_->OnShelfAlignmentChanged();
- delegate_->OnShelfAlignmentChanged(this);
+ WmShell::Get()->shelf_delegate()->OnShelfAlignmentChanged(this);
Shell::GetInstance()->OnShelfAlignmentChanged(
WmWindowAura::Get(shelf_widget_->GetNativeWindow()->GetRootWindow()));
// ShelfLayoutManager will resize the shelf.
@@ -97,7 +99,7 @@ void Shelf::SetAutoHideBehavior(ShelfAutoHideBehavior auto_hide_behavior) {
return;
auto_hide_behavior_ = auto_hide_behavior;
- delegate_->OnShelfAutoHideBehaviorChanged(this);
+ WmShell::Get()->shelf_delegate()->OnShelfAutoHideBehaviorChanged(this);
Shell::GetInstance()->OnShelfAutoHideBehaviorChanged(
WmWindowAura::Get(shelf_widget_->GetNativeWindow()->GetRootWindow()));
}
« no previous file with comments | « ash/shelf/shelf.h ('k') | ash/shelf/shelf_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698