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

Unified Diff: views/controls/button/menu_button.cc

Issue 344043: Fixes regression introduced in fixing 19597. This change effectively... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/button/menu_button.cc
===================================================================
--- views/controls/button/menu_button.cc (revision 30584)
+++ views/controls/button/menu_button.cc (working copy)
@@ -188,9 +188,13 @@
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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698