summaryrefslogtreecommitdiffstats
path: root/ash/shelf
diff options
context:
space:
mode:
authorsimonhong@chromium.org <simonhong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-20 12:55:33 +0000
committersimonhong@chromium.org <simonhong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-20 12:55:33 +0000
commitb7cebb01cbf4cd60451244bcf512634bbf64d46d (patch)
tree0096c041d72ebee04e5a3df96e1dfe036f4f4d7f /ash/shelf
parent5751a2e48db3503efffd1f85d39d86735769de8a (diff)
downloadchromium_src-b7cebb01cbf4cd60451244bcf512634bbf64d46d.zip
chromium_src-b7cebb01cbf4cd60451244bcf512634bbf64d46d.tar.gz
chromium_src-b7cebb01cbf4cd60451244bcf512634bbf64d46d.tar.bz2
[ash] Create applist button's context menu in its ShelfItemDelegate
The context menu of applist button should create by its ShelfItemDelegate. R=jamescook@chromium.org BUG=NONE TEST=manual test Review URL: https://codereview.chromium.org/119643002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242083 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/shelf')
-rw-r--r--ash/shelf/app_list_shelf_item_delegate.cc3
-rw-r--r--ash/shelf/shelf_view.cc7
2 files changed, 3 insertions, 7 deletions
diff --git a/ash/shelf/app_list_shelf_item_delegate.cc b/ash/shelf/app_list_shelf_item_delegate.cc
index 7013d2b..8d56de6 100644
--- a/ash/shelf/app_list_shelf_item_delegate.cc
+++ b/ash/shelf/app_list_shelf_item_delegate.cc
@@ -6,6 +6,7 @@
#include "ash/shelf/shelf_model.h"
#include "ash/shell.h"
+#include "ash/shell_delegate.h"
#include "grit/ash_strings.h"
#include "ui/base/l10n/l10n_util.h"
@@ -38,7 +39,7 @@ base::string16 AppListShelfItemDelegate::GetTitle() {
ui::MenuModel* AppListShelfItemDelegate::CreateContextMenu(
aura::Window* root_window) {
- return NULL;
+ return Shell::GetInstance()->delegate()->CreateContextMenu(root_window);
}
ShelfMenuModel* AppListShelfItemDelegate::CreateApplicationMenu(
diff --git a/ash/shelf/shelf_view.cc b/ash/shelf/shelf_view.cc
index 01dfae4..b339c2c 100644
--- a/ash/shelf/shelf_view.cc
+++ b/ash/shelf/shelf_view.cc
@@ -1827,16 +1827,11 @@ void ShelfView::ShowContextMenuForView(views::View* source,
const gfx::Point& point,
ui::MenuSourceType source_type) {
int view_index = view_model_->GetIndexOfView(source);
- // TODO(simon.hong81): Create LauncherContextMenu for applist in its
- // ShelfItemDelegate.
- if (view_index != -1 && model_->items()[view_index].type == TYPE_APP_LIST) {
- view_index = -1;
- }
-
if (view_index == -1) {
Shell::GetInstance()->ShowContextMenu(point, source_type);
return;
}
+
scoped_ptr<ui::MenuModel> menu_model;
ShelfItemDelegate* item_delegate = item_manager_->GetShelfItemDelegate(
model_->items()[view_index].id);