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

Unified Diff: ui/views/examples/tree_view_example.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
« no previous file with comments | « ui/views/examples/tree_view_example.h ('k') | ui/views/view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/examples/tree_view_example.cc
diff --git a/ui/views/examples/tree_view_example.cc b/ui/views/examples/tree_view_example.cc
index 9d1af4e6e8af0d697411c3445a09d9b363c9b434..a7a51cbaf4506299777cfb2977e99cb9ddb66d48 100644
--- a/ui/views/examples/tree_view_example.cc
+++ b/ui/views/examples/tree_view_example.cc
@@ -123,14 +123,15 @@ bool TreeViewExample::CanEdit(TreeView* tree_view,
}
void TreeViewExample::ShowContextMenuForView(View* source,
- const gfx::Point& point) {
+ const gfx::Point& point,
+ ui::MenuSourceType source_type) {
ui::SimpleMenuModel context_menu_model(this);
context_menu_model.AddItem(ID_EDIT, ASCIIToUTF16("Edit"));
context_menu_model.AddItem(ID_REMOVE, ASCIIToUTF16("Remove"));
context_menu_model.AddItem(ID_ADD, ASCIIToUTF16("Add"));
context_menu_runner_.reset(new MenuRunner(&context_menu_model));
if (context_menu_runner_->RunMenuAt(source->GetWidget(), NULL,
- gfx::Rect(point, gfx::Size()), MenuItemView::TOPLEFT, 0) ==
+ gfx::Rect(point, gfx::Size()), MenuItemView::TOPLEFT, source_type, 0) ==
MenuRunner::MENU_DELETED)
return;
}
« no previous file with comments | « ui/views/examples/tree_view_example.h ('k') | ui/views/view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698