diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-11 22:16:38 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-11 22:16:38 +0000 |
commit | c4c052845d062c1ff7ce74e2b94922463039e632 (patch) | |
tree | 2416f3b7f67852e57686656982a407234ce53936 /ui | |
parent | 25c3d7b0d4d8dbfcda2f5e4f55f68c626dee27f1 (diff) | |
download | chromium_src-c4c052845d062c1ff7ce74e2b94922463039e632.zip chromium_src-c4c052845d062c1ff7ce74e2b94922463039e632.tar.gz chromium_src-c4c052845d062c1ff7ce74e2b94922463039e632.tar.bz2 |
views: Nuke is_mouse_gesture parameter from ContextMenuController::ShowContextMenuForView().
BUG=117092
R=sky@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9665008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126081 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/views/context_menu_controller.h | 13 | ||||
-rw-r--r-- | ui/views/controls/scrollbar/base_scroll_bar.cc | 10 | ||||
-rw-r--r-- | ui/views/controls/scrollbar/base_scroll_bar.h | 5 | ||||
-rw-r--r-- | ui/views/controls/textfield/native_textfield_views.cc | 10 | ||||
-rw-r--r-- | ui/views/controls/textfield/native_textfield_views.h | 3 | ||||
-rw-r--r-- | ui/views/examples/tree_view_example.cc | 5 | ||||
-rw-r--r-- | ui/views/examples/tree_view_example.h | 3 | ||||
-rw-r--r-- | ui/views/view.cc | 2 |
8 files changed, 19 insertions, 32 deletions
diff --git a/ui/views/context_menu_controller.h b/ui/views/context_menu_controller.h index 5bee8b7..e427117 100644 --- a/ui/views/context_menu_controller.h +++ b/ui/views/context_menu_controller.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -28,15 +28,10 @@ class View; // implementation for mouse processing. class VIEWS_EXPORT ContextMenuController { public: - // Invoked to show the context menu for the source view. If |is_mouse_gesture| - // is true, |p| is the location of the mouse. If |is_mouse_gesture| is false, - // this method was not invoked by a mouse gesture and |p| is the recommended - // location to show the menu at. - // - // |p| is in screen coordinates. + // Invoked to show the context menu for |source|. + // |point| is in screen coordinates. virtual void ShowContextMenuForView(View* source, - const gfx::Point& p, - bool is_mouse_gesture) = 0; + const gfx::Point& point) = 0; protected: virtual ~ContextMenuController() {} diff --git a/ui/views/controls/scrollbar/base_scroll_bar.cc b/ui/views/controls/scrollbar/base_scroll_bar.cc index 54d4b44..01ef304 100644 --- a/ui/views/controls/scrollbar/base_scroll_bar.cc +++ b/ui/views/controls/scrollbar/base_scroll_bar.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -202,9 +202,7 @@ enum ScrollBarContextMenuCommands { ScrollBarContextMenuCommand_ScrollNext }; -void BaseScrollBar::ShowContextMenuForView(View* source, - const gfx::Point& p, - bool is_mouse_gesture) { +void BaseScrollBar::ShowContextMenuForView(View* source, const gfx::Point& p) { Widget* widget = GetWidget(); gfx::Rect widget_bounds = widget->GetWindowScreenBounds(); gfx::Point temp_pt(p.x() - widget_bounds.x(), p.y() - widget_bounds.y()); @@ -224,8 +222,8 @@ void BaseScrollBar::ShowContextMenuForView(View* source, menu->AppendSeparator(); menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollPrev); menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollNext); - if (menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(p, gfx::Size(0, 0)), - MenuItemView::TOPLEFT, MenuRunner::HAS_MNEMONICS) == + if (menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(p, gfx::Size()), + MenuItemView::TOPLEFT, MenuRunner::HAS_MNEMONICS) == MenuRunner::MENU_DELETED) return; } diff --git a/ui/views/controls/scrollbar/base_scroll_bar.h b/ui/views/controls/scrollbar/base_scroll_bar.h index 46515d5..d7e8b8c 100644 --- a/ui/views/controls/scrollbar/base_scroll_bar.h +++ b/ui/views/controls/scrollbar/base_scroll_bar.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -74,8 +74,7 @@ class VIEWS_EXPORT BaseScrollBar : public ScrollBar, // ContextMenuController overrides. virtual void ShowContextMenuForView(View* source, - const gfx::Point& p, - bool is_mouse_gesture) OVERRIDE; + const gfx::Point& point) OVERRIDE; // Menu::Delegate overrides: virtual string16 GetLabel(int id) const OVERRIDE; diff --git a/ui/views/controls/textfield/native_textfield_views.cc b/ui/views/controls/textfield/native_textfield_views.cc index 709a031..ab41c83 100644 --- a/ui/views/controls/textfield/native_textfield_views.cc +++ b/ui/views/controls/textfield/native_textfield_views.cc @@ -295,13 +295,11 @@ gfx::NativeCursor NativeTextfieldViews::GetCursor(const MouseEvent& event) { ///////////////////////////////////////////////////////////////// // NativeTextfieldViews, ContextMenuController overrides: void NativeTextfieldViews::ShowContextMenuForView(View* source, - const gfx::Point& p, - bool is_mouse_gesture) { + const gfx::Point& point) { UpdateContextMenu(); - if (context_menu_runner_->RunMenuAt( - GetWidget(), NULL, gfx::Rect(p, gfx::Size()), - views::MenuItemView::TOPLEFT, MenuRunner::HAS_MNEMONICS) == - MenuRunner::MENU_DELETED) + if (context_menu_runner_->RunMenuAt(GetWidget(), NULL, + gfx::Rect(point, gfx::Size()), views::MenuItemView::TOPLEFT, + MenuRunner::HAS_MNEMONICS) == MenuRunner::MENU_DELETED) return; } diff --git a/ui/views/controls/textfield/native_textfield_views.h b/ui/views/controls/textfield/native_textfield_views.h index 722d295..83341e1 100644 --- a/ui/views/controls/textfield/native_textfield_views.h +++ b/ui/views/controls/textfield/native_textfield_views.h @@ -76,8 +76,7 @@ class VIEWS_EXPORT NativeTextfieldViews : public TouchSelectionClientView, // ContextMenuController overrides: virtual void ShowContextMenuForView(View* source, - const gfx::Point& p, - bool is_mouse_gesture) OVERRIDE; + const gfx::Point& point) OVERRIDE; // Overridden from DragController: virtual void WriteDragDataForView(View* sender, diff --git a/ui/views/examples/tree_view_example.cc b/ui/views/examples/tree_view_example.cc index cd98d07..e2a9d4f 100644 --- a/ui/views/examples/tree_view_example.cc +++ b/ui/views/examples/tree_view_example.cc @@ -123,8 +123,7 @@ bool TreeViewExample::CanEdit(TreeView* tree_view, } void TreeViewExample::ShowContextMenuForView(View* source, - const gfx::Point& p, - bool is_mouse_gesture) { + const gfx::Point& point) { ui::SimpleMenuModel context_menu_model(this); context_menu_model.AddItem(ID_EDIT, ASCIIToUTF16("Edit")); context_menu_model.AddItem(ID_REMOVE, ASCIIToUTF16("Remove")); @@ -132,7 +131,7 @@ void TreeViewExample::ShowContextMenuForView(View* source, views::MenuModelAdapter menu_adapter(&context_menu_model); context_menu_runner_.reset(new views::MenuRunner(menu_adapter.CreateMenu())); if (context_menu_runner_->RunMenuAt(source->GetWidget(), NULL, - gfx::Rect(p, gfx::Size()), views::MenuItemView::TOPLEFT, 0) == + gfx::Rect(point, gfx::Size()), views::MenuItemView::TOPLEFT, 0) == views::MenuRunner::MENU_DELETED) return; } diff --git a/ui/views/examples/tree_view_example.h b/ui/views/examples/tree_view_example.h index 99ed43b..4709091 100644 --- a/ui/views/examples/tree_view_example.h +++ b/ui/views/examples/tree_view_example.h @@ -57,8 +57,7 @@ class TreeViewExample : public ExampleBase, // ContextMenuController: virtual void ShowContextMenuForView(View* source, - const gfx::Point& p, - bool is_mouse_gesture) OVERRIDE; + const gfx::Point& point) OVERRIDE; // SimpleMenuModel::Delegate: virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; diff --git a/ui/views/view.cc b/ui/views/view.cc index 9cb513e..fb9e774 100644 --- a/ui/views/view.cc +++ b/ui/views/view.cc @@ -992,7 +992,7 @@ void View::ShowContextMenu(const gfx::Point& p, bool is_mouse_gesture) { if (!context_menu_controller_) return; - context_menu_controller_->ShowContextMenuForView(this, p, is_mouse_gesture); + context_menu_controller_->ShowContextMenuForView(this, p); } // Drag and drop --------------------------------------------------------------- |