summaryrefslogtreecommitdiffstats
path: root/views/controls/button
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-30 23:51:28 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-30 23:51:28 +0000
commit9b48e1b12ac878603851830e7a57df3962c5848b (patch)
tree7295ff5b72da68923801280fbc2957e80bbaacb2 /views/controls/button
parente337ad47eab483f5db779fc25c7d42467ce31e70 (diff)
downloadchromium_src-9b48e1b12ac878603851830e7a57df3962c5848b.zip
chromium_src-9b48e1b12ac878603851830e7a57df3962c5848b.tar.gz
chromium_src-9b48e1b12ac878603851830e7a57df3962c5848b.tar.bz2
Fixes regression introduced in fixing 19597. This change effectively
reverts menu_button to what it was before the fix. This way 19597 is still fixed, and we don't have this crash. I'm working on a regression test for coverage of this, but I don't want to hold up anything with the fix. BUG=26279 TEST=see bug Review URL: http://codereview.chromium.org/344043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30651 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/button')
-rw-r--r--views/controls/button/menu_button.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/views/controls/button/menu_button.cc b/views/controls/button/menu_button.cc
index ced0942..7fb81cb 100644
--- a/views/controls/button/menu_button.cc
+++ b/views/controls/button/menu_button.cc
@@ -188,9 +188,13 @@ bool MenuButton::OnMousePressed(const MouseEvent& e) {
void MenuButton::OnMouseReleased(const MouseEvent& e,
bool canceled) {
+ // Explicitly test for left mouse button to show the menu. If we tested for
+ // !IsTriggerableEvent it could lead to a situation where we end up showing
+ // the menu and context menu (this would happen if the right button is not
+ // triggerable and there's a context menu).
if (GetDragOperations(e.x(), e.y()) != DragDropTypes::DRAG_NONE &&
- state() != BS_DISABLED && !canceled && !InDrag() && !IsTriggerableEvent(e)
- && HitTest(e.location())) {
+ state() != BS_DISABLED && !canceled && !InDrag() &&
+ e.IsOnlyLeftMouseButton() && HitTest(e.location())) {
Activate();
} else {
TextButton::OnMouseReleased(e, canceled);