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

Unified Diff: chrome/browser/ui/views/task_manager_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/task_manager_view.cc
diff --git a/chrome/browser/ui/views/task_manager_view.cc b/chrome/browser/ui/views/task_manager_view.cc
index 7b50abeb5a8c9d950fc40d7f72c7c5b2f8b4e081..bcb6895283fb7abd431d35f0444b457e04eb438d 100644
--- a/chrome/browser/ui/views/task_manager_view.cc
+++ b/chrome/browser/ui/views/task_manager_view.cc
@@ -242,8 +242,10 @@ class TaskManagerView : public views::ButtonListener,
void UpdateStatsCounters();
// views::ContextMenuController:
- virtual void ShowContextMenuForView(views::View* source,
- const gfx::Point& point) OVERRIDE;
+ virtual void ShowContextMenuForView(
+ views::View* source,
+ const gfx::Point& point,
+ ui::ContextMenuSourceType source_type) OVERRIDE;
// ui::SimpleMenuModel::Delegate:
virtual bool IsCommandIdChecked(int id) const OVERRIDE;
@@ -682,8 +684,10 @@ void TaskManagerView::LinkClicked(views::Link* source, int event_flags) {
task_manager_->OpenAboutMemory(desktop_type_);
}
-void TaskManagerView::ShowContextMenuForView(views::View* source,
- const gfx::Point& point) {
+void TaskManagerView::ShowContextMenuForView(
+ views::View* source,
+ const gfx::Point& point,
+ ui::ContextMenuSourceType source_type) {
UpdateStatsCounters();
ui::SimpleMenuModel menu_model(this);
for (std::vector<ui::TableColumn>::iterator i(columns_.begin());
@@ -691,9 +695,10 @@ void TaskManagerView::ShowContextMenuForView(views::View* source,
menu_model.AddCheckItem(i->id, l10n_util::GetStringUTF16(i->id));
}
menu_runner_.reset(new views::MenuRunner(&menu_model));
- if (menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(point, gfx::Size()),
- views::MenuItemView::TOPLEFT,
- views::MenuRunner::CONTEXT_MENU) ==
+ if (menu_runner_->RunContextMenuAt(GetWidget(), NULL,
+ gfx::Rect(point, gfx::Size()),
+ source_type,
+ views::MenuRunner::CONTEXT_MENU) ==
views::MenuRunner::MENU_DELETED)
return;
}

Powered by Google App Engine
This is Rietveld 408576698