summaryrefslogtreecommitdiffstats
path: root/ash/shelf/shelf_view.cc
diff options
context:
space:
mode:
authormsw <msw@chromium.org>2016-03-03 16:55:30 -0800
committerCommit bot <commit-bot@chromium.org>2016-03-04 00:56:52 +0000
commit141c6b246d3cbb3212f76602ca40915c152af89a (patch)
tree868d70ec80d26dbf91ccda25ef1d295947a04c3b /ash/shelf/shelf_view.cc
parent243b2e8fb9cdd09cf9ec11aa2a68e26c76e00ee7 (diff)
downloadchromium_src-141c6b246d3cbb3212f76602ca40915c152af89a.zip
chromium_src-141c6b246d3cbb3212f76602ca40915c152af89a.tar.gz
chromium_src-141c6b246d3cbb3212f76602ca40915c152af89a.tar.bz2
Simplify ash context menu creation.
Remove ash::ShelfItemDelegate::CreateContextMenu. Use ash::ShellDelegate::CreateContextMenu instead. (this is what all the impls do anyway...) Don't pass the ShelfItemDelegate, look up as needed. Only create |extension_items_| as needed. Don't ask |extension_items_| for local enabled/checked state. Remove non-cros logic from LauncherContextMenu. Support null in GetAppIDForShelfID for app list button. TODO: Refine menu model creation pattern to support mash. BUG=557406 TEST=No behavior changes or regressions. R=sky@chromium.org Review URL: https://codereview.chromium.org/1762813002 Cr-Commit-Position: refs/heads/master@{#379158}
Diffstat (limited to 'ash/shelf/shelf_view.cc')
-rw-r--r--ash/shelf/shelf_view.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/ash/shelf/shelf_view.cc b/ash/shelf/shelf_view.cc
index 262aed8..1217e74 100644
--- a/ash/shelf/shelf_view.cc
+++ b/ash/shelf/shelf_view.cc
@@ -26,6 +26,7 @@
#include "ash/shelf/shelf_tooltip_manager.h"
#include "ash/shelf/shelf_widget.h"
#include "ash/shell.h"
+#include "ash/shell_delegate.h"
#include "ash/wm/coordinate_conversion.h"
#include "base/auto_reset.h"
#include "base/memory/scoped_ptr.h"
@@ -1796,10 +1797,9 @@ void ShelfView::ShowContextMenuForView(views::View* source,
return;
}
- ShelfItemDelegate* item_delegate = item_manager_->GetShelfItemDelegate(
- model_->items()[view_index].id);
- context_menu_model_.reset(item_delegate->CreateContextMenu(
- source->GetWidget()->GetNativeView()->GetRootWindow()));
+ context_menu_model_.reset(Shell::GetInstance()->delegate()->CreateContextMenu(
+ source->GetWidget()->GetNativeView()->GetRootWindow(),
+ &model_->items()[view_index]));
if (!context_menu_model_)
return;