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

Unified Diff: ash/shelf/shelf_view.cc

Issue 2046843005: mash: Migrate shelf menus to wm common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ash_shell_with_content 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_view.h ('k') | ash/shelf/shelf_widget.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_view.cc
diff --git a/ash/shelf/shelf_view.cc b/ash/shelf/shelf_view.cc
index f2bf74f0be601364d8a1a4a3925c5ff54c02601b..ef45974c24a05b2cfd39bd30d2dfbc0930640252 100644
--- a/ash/shelf/shelf_view.cc
+++ b/ash/shelf/shelf_view.cc
@@ -362,9 +362,13 @@ class ShelfView::StartFadeAnimationDelegate : public gfx::AnimationDelegate {
DISALLOW_COPY_AND_ASSIGN(StartFadeAnimationDelegate);
};
-ShelfView::ShelfView(ShelfModel* model, ShelfDelegate* delegate, Shelf* shelf)
+ShelfView::ShelfView(ShelfModel* model,
+ ShelfDelegate* delegate,
+ WmShelf* wm_shelf,
+ Shelf* shelf)
: model_(model),
delegate_(delegate),
+ wm_shelf_(wm_shelf),
shelf_(shelf),
view_model_(new views::ViewModel),
first_visible_index_(0),
@@ -393,6 +397,7 @@ ShelfView::ShelfView(ShelfModel* model, ShelfDelegate* delegate, Shelf* shelf)
is_repost_event_(false),
last_pressed_index_(-1) {
DCHECK(model_);
+ DCHECK(wm_shelf_);
bounds_animator_.reset(new views::BoundsAnimator(this));
bounds_animator_->AddObserver(this);
set_context_menu_controller(this);
@@ -1355,7 +1360,8 @@ void ShelfView::ToggleOverflowBubble() {
if (!overflow_bubble_)
overflow_bubble_.reset(new OverflowBubble());
- ShelfView* overflow_view = new ShelfView(model_, delegate_, shelf_);
+ ShelfView* overflow_view =
+ new ShelfView(model_, delegate_, wm_shelf_, shelf_);
overflow_view->overflow_mode_ = true;
overflow_view->Init();
overflow_view->set_owner_overflow_bubble(overflow_bubble_.get());
@@ -1775,7 +1781,7 @@ void ShelfView::ShowContextMenuForView(views::View* source,
}
std::unique_ptr<ui::MenuModel> context_menu_model(
- Shell::GetInstance()->delegate()->CreateContextMenu(shelf_, item));
+ Shell::GetInstance()->delegate()->CreateContextMenu(wm_shelf_, item));
if (!context_menu_model)
return;
« no previous file with comments | « ash/shelf/shelf_view.h ('k') | ash/shelf/shelf_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698