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

Unified Diff: chrome/browser/ui/views/location_bar/page_action_image_view.cc

Issue 16979002: Add ContextMenuSourceType to views::ContextMenuController::ShowContextMenuForView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/location_bar/page_action_image_view.cc
diff --git a/chrome/browser/ui/views/location_bar/page_action_image_view.cc b/chrome/browser/ui/views/location_bar/page_action_image_view.cc
index cad5c54a62730649ebc138585beeb4b466057f63..56695acd58bff3a561fad297d3119d44ffcabbee 100644
--- a/chrome/browser/ui/views/location_bar/page_action_image_view.cc
+++ b/chrome/browser/ui/views/location_bar/page_action_image_view.cc
@@ -175,8 +175,10 @@ bool PageActionImageView::OnKeyPressed(const ui::KeyEvent& event) {
return false;
}
-void PageActionImageView::ShowContextMenuForView(View* source,
- const gfx::Point& point) {
+void PageActionImageView::ShowContextMenuForView(
+ View* source,
+ const gfx::Point& point,
+ ui::ContextMenuSourceType source_type) {
const Extension* extension = owner_->profile()->GetExtensionService()->
GetExtensionById(page_action()->extension_id(), false);
if (!extension->ShowConfigureContextMenus())
@@ -187,8 +189,9 @@ void PageActionImageView::ShowContextMenuForView(View* source,
menu_runner_.reset(new views::MenuRunner(context_menu_model.get()));
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 |
+ if (menu_runner_->RunContextMenuAt(GetWidget(), NULL,
+ gfx::Rect(screen_loc, size()),
+ source_type, views::MenuRunner::HAS_MNEMONICS |
views::MenuRunner::CONTEXT_MENU) ==
views::MenuRunner::MENU_DELETED)
return;

Powered by Google App Engine
This is Rietveld 408576698