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

Unified Diff: ui/views/controls/scrollbar/base_scroll_bar.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: ui/views/controls/scrollbar/base_scroll_bar.cc
diff --git a/ui/views/controls/scrollbar/base_scroll_bar.cc b/ui/views/controls/scrollbar/base_scroll_bar.cc
index 64b1d13a06edf9f464890403513d0c680079eac5..0e684be831e96a86bd3981aee67b75381f9c6215 100644
--- a/ui/views/controls/scrollbar/base_scroll_bar.cc
+++ b/ui/views/controls/scrollbar/base_scroll_bar.cc
@@ -273,7 +273,10 @@ enum ScrollBarContextMenuCommands {
ScrollBarContextMenuCommand_ScrollNext
};
-void BaseScrollBar::ShowContextMenuForView(View* source, const gfx::Point& p) {
+void BaseScrollBar::ShowContextMenuForView(
+ View* source,
+ const gfx::Point& p,
+ ui::ContextMenuSourceType source_type) {
Widget* widget = GetWidget();
gfx::Rect widget_bounds = widget->GetWindowBoundsInScreen();
gfx::Point temp_pt(p.x() - widget_bounds.x(), p.y() - widget_bounds.y());
@@ -293,8 +296,9 @@ void BaseScrollBar::ShowContextMenuForView(View* source, const gfx::Point& p) {
menu->AppendSeparator();
menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollPrev);
menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollNext);
- if (menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(p, gfx::Size()),
- MenuItemView::TOPLEFT, MenuRunner::HAS_MNEMONICS |
+ if (menu_runner_->RunContextMenuAt(GetWidget(), NULL,
+ gfx::Rect(p, gfx::Size()),
+ source_type, MenuRunner::HAS_MNEMONICS |
views::MenuRunner::CONTEXT_MENU) ==
MenuRunner::MENU_DELETED)
return;

Powered by Google App Engine
This is Rietveld 408576698