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

Unified Diff: ash/launcher/launcher_view.cc

Issue 16979002: Add ContextMenuSourceType to views::ContextMenuController::ShowContextMenuForView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win build Created 7 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
Index: ash/launcher/launcher_view.cc
diff --git a/ash/launcher/launcher_view.cc b/ash/launcher/launcher_view.cc
index 0d1f89872c8e304a0210b429bf6a8db7926152f3..267013b3b369307d9bad5aa71f42f0fa899ec8e2 100644
--- a/ash/launcher/launcher_view.cc
+++ b/ash/launcher/launcher_view.cc
@@ -1516,12 +1516,14 @@ bool LauncherView::ShowListMenuForView(const LauncherItem& item,
new LauncherMenuModelAdapter(menu_model.get())),
source,
gfx::Point(),
- false);
+ false,
+ ui::MENU_SOURCE_NONE);
sky 2013/06/17 16:08:19 This can be invoked from touch or keyboard.
varunjain 2013/06/17 20:13:55 Done.
return true;
}
void LauncherView::ShowContextMenuForView(views::View* source,
- const gfx::Point& point) {
+ const gfx::Point& point,
+ ui:: MenuSourceType source_type) {
int view_index = view_model_->GetIndexOfView(source);
if (view_index != -1 &&
model_->items()[view_index].type == TYPE_APP_LIST) {
@@ -1531,7 +1533,7 @@ void LauncherView::ShowContextMenuForView(views::View* source,
tooltip_->Close();
if (view_index == -1) {
- Shell::GetInstance()->ShowContextMenu(point);
+ Shell::GetInstance()->ShowContextMenu(point, source_type);
return;
}
scoped_ptr<ui::MenuModel> menu_model(delegate_->CreateContextMenu(
@@ -1547,14 +1549,16 @@ void LauncherView::ShowContextMenuForView(views::View* source,
new views::MenuModelAdapter(menu_model.get())),
source,
point,
- true);
+ true,
+ source_type);
}
void LauncherView::ShowMenu(
scoped_ptr<views::MenuModelAdapter> menu_model_adapter,
views::View* source,
const gfx::Point& click_point,
- bool context_menu) {
+ bool context_menu,
+ ui::MenuSourceType source_type) {
closing_event_time_ = base::TimeDelta();
launcher_menu_runner_.reset(
new views::MenuRunner(menu_model_adapter->CreateMenu()));
@@ -1612,7 +1616,9 @@ void LauncherView::ShowMenu(
NULL,
anchor_point,
menu_alignment,
- views::MenuRunner::CONTEXT_MENU) == views::MenuRunner::MENU_DELETED) {
+ source_type,
+ context_menu ? views::MenuRunner::CONTEXT_MENU : 0) ==
+ views::MenuRunner::MENU_DELETED) {
if (!got_deleted) {
got_deleted_ = NULL;
shelf->ForceUndimming(false);

Powered by Google App Engine
This is Rietveld 408576698