diff options
author | flackr@chromium.org <flackr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-30 23:18:44 +0000 |
---|---|---|
committer | flackr@chromium.org <flackr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-30 23:18:44 +0000 |
commit | e9908c90f06bf2720255072834a189bf9c51907a (patch) | |
tree | 6de1c09ad120562f10c220e382213e768922f72d /ui/views | |
parent | 56d05263bc142647aca44033a858fa546660f17b (diff) | |
download | chromium_src-e9908c90f06bf2720255072834a189bf9c51907a.zip chromium_src-e9908c90f06bf2720255072834a189bf9c51907a.tar.gz chromium_src-e9908c90f06bf2720255072834a189bf9c51907a.tar.bz2 |
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
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@179731 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views')
-rw-r--r-- | ui/views/controls/button/button_dropdown.cc | 13 | ||||
-rw-r--r-- | ui/views/controls/button/button_dropdown.h | 5 |
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 |