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

Unified Diff: chrome/browser/ui/views/browser_action_view.cc

Issue 16979002: Add ContextMenuSourceType to views::ContextMenuController::ShowContextMenuForView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch 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: chrome/browser/ui/views/browser_action_view.cc
diff --git a/chrome/browser/ui/views/browser_action_view.cc b/chrome/browser/ui/views/browser_action_view.cc
index 73db0f0035a384fe380332aabbad3a9d68e34f0d..3f43bb966a9c56c8affdb897c70c088ca718e39c 100644
--- a/chrome/browser/ui/views/browser_action_view.cc
+++ b/chrome/browser/ui/views/browser_action_view.cc
@@ -175,8 +175,10 @@ void BrowserActionButton::ButtonPressed(views::Button* sender,
delegate_->OnBrowserActionExecuted(this);
}
-void BrowserActionButton::ShowContextMenuForView(View* source,
- const gfx::Point& point) {
+void BrowserActionButton::ShowContextMenuForView(
+ View* source,
+ const gfx::Point& point,
+ ui::MenuSourceType source_type) {
if (!extension()->ShowConfigureContextMenus())
return;
@@ -191,8 +193,8 @@ void BrowserActionButton::ShowContextMenuForView(View* source,
gfx::Point screen_loc;
views::View::ConvertPointToScreen(this, &screen_loc);
if (menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(screen_loc, size()),
- views::MenuItemView::TOPLEFT, views::MenuRunner::HAS_MNEMONICS |
- views::MenuRunner::CONTEXT_MENU) ==
+ views::MenuItemView::TOPLEFT, source_type,
+ views::MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU) ==
views::MenuRunner::MENU_DELETED) {
return;
}
@@ -316,7 +318,7 @@ bool BrowserActionButton::OnMousePressed(const ui::MouseEvent& event) {
// See comments in MenuButton::Activate() as to why this is needed.
SetMouseHandler(NULL);
- ShowContextMenu(gfx::Point(), true);
+ ShowContextMenu(gfx::Point(), ui::MENU_SOURCE_MOUSE);
}
return false;
}
« no previous file with comments | « chrome/browser/ui/views/browser_action_view.h ('k') | chrome/browser/ui/views/content_setting_bubble_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698