summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorflackr@chromium.org <flackr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-01 15:51:29 +0000
committerflackr@chromium.org <flackr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-01 15:51:29 +0000
commit61fbfef6aa82ad551f96a777870c103058a83823 (patch)
tree1759099eb61cd4babde5fe536a496b45e8ce69ec
parentac4e437ab0b3c4087418500af06a8a5ac481c0c0 (diff)
downloadchromium_src-61fbfef6aa82ad551f96a777870c103058a83823.zip
chromium_src-61fbfef6aa82ad551f96a777870c103058a83823.tar.gz
chromium_src-61fbfef6aa82ad551f96a777870c103058a83823.tar.bz2
Merge 179731
> Don't set button state to hover after menu is displayed. > > BUG=172173 > TEST=Navigate to a webpage, follow a link, go back, right click on forward button and click on link. Forward button should be grayed out. > > > Review URL: https://chromiumcodereview.appspot.com/12093060 TBR=flackr@chromium.org Review URL: https://codereview.chromium.org/12082117 git-svn-id: svn://svn.chromium.org/chrome/branches/1364/src@180145 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--ui/views/controls/button/button_dropdown.cc13
-rw-r--r--ui/views/controls/button/button_dropdown.h5
2 files changed, 9 insertions, 9 deletions
diff --git a/ui/views/controls/button/button_dropdown.cc b/ui/views/controls/button/button_dropdown.cc
index ccce309..fc34288 100644
--- a/ui/views/controls/button/button_dropdown.cc
+++ b/ui/views/controls/button/button_dropdown.cc
@@ -114,11 +114,14 @@ void ButtonDropDown::OnMouseExited(const ui::MouseEvent& event) {
SetState(STATE_NORMAL);
}
-void ButtonDropDown::ShowContextMenu(const gfx::Point& p,
- bool is_mouse_gesture) {
- show_menu_factory_.InvalidateWeakPtrs();
- ShowDropDownMenu();
- SetState(STATE_HOVERED);
+void ButtonDropDown::OnGestureEvent(ui::GestureEvent* event) {
+ if (menu_showing_) {
+ // While dropdown menu is showing the button should not handle gestures.
+ event->StopPropagation();
+ return;
+ }
+
+ ImageButton::OnGestureEvent(event);
}
void ButtonDropDown::GetAccessibleState(ui::AccessibleViewState* state) {
diff --git a/ui/views/controls/button/button_dropdown.h b/ui/views/controls/button/button_dropdown.h
index b7870a5..1fe1c02 100644
--- a/ui/views/controls/button/button_dropdown.h
+++ b/ui/views/controls/button/button_dropdown.h
@@ -49,10 +49,7 @@ class VIEWS_EXPORT ButtonDropDown : public ImageButton,
// Showing the drop down results in a MouseCaptureLost, we need to ignore it.
virtual void OnMouseCaptureLost() OVERRIDE {}
virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE;
- // Display the right-click menu, as triggered by the keyboard, for instance.
- // Using the member function ShowDropDownMenu for the actual display.
- virtual void ShowContextMenu(const gfx::Point& p,
- bool is_mouse_gesture) OVERRIDE;
+ virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
// Overridden from views::ContextMenuController