diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-20 16:14:29 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-20 16:14:29 +0000 |
commit | 1e5babb0c100f18e2f0b67c3709d5b6981ebf537 (patch) | |
tree | 07974e33e76abf67e61183fe668514980d58937e | |
parent | 64206bb3c3e9a42f047c6d66f38cba12ef638cd4 (diff) | |
download | chromium_src-1e5babb0c100f18e2f0b67c3709d5b6981ebf537.zip chromium_src-1e5babb0c100f18e2f0b67c3709d5b6981ebf537.tar.gz chromium_src-1e5babb0c100f18e2f0b67c3709d5b6981ebf537.tar.bz2 |
Show extension action context menus on mouse up
instead of mouse down.
BUG=33155
TEST=Make sure right-click menus for Page Actions
still work. Then right-click a Page Action and
while the context menu is up, right click a
browser action/bookmark bar (the right menu should
show).
Review URL: http://codereview.chromium.org/650087
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39556 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/views/location_bar_view.cc | 14 | ||||
-rw-r--r-- | chrome/browser/views/location_bar_view.h | 1 |
2 files changed, 13 insertions, 2 deletions
diff --git a/chrome/browser/views/location_bar_view.cc b/chrome/browser/views/location_bar_view.cc index 18d0f1a..29ebabe 100644 --- a/chrome/browser/views/location_bar_view.cc +++ b/chrome/browser/views/location_bar_view.cc @@ -1527,6 +1527,17 @@ void LocationBarView::PageActionImageView::OnMouseMoved( bool LocationBarView::PageActionImageView::OnMousePressed( const views::MouseEvent& event) { + // We are interested in capturing mouse messages, but we want want to wait + // until mouse-up because we might show a context menu. Doing so on mouse-down + // causes weird bugs like http://crbug.com/33155. + return true; +} + +void LocationBarView::PageActionImageView::OnMouseReleased( + const views::MouseEvent& event, bool canceled) { + if (canceled) + return; + int button = -1; if (event.IsLeftMouseButton()) { button = 1; @@ -1546,11 +1557,10 @@ bool LocationBarView::PageActionImageView::OnMousePressed( if (!context_menu_.get()) context_menu_.reset(new ExtensionActionContextMenu()); context_menu_->Run(extension, point); - return false; + return; } ExecuteAction(button); - return true; } void LocationBarView::PageActionImageView::ShowInfoBubble() { diff --git a/chrome/browser/views/location_bar_view.h b/chrome/browser/views/location_bar_view.h index d2fefaa..a48bb8e 100644 --- a/chrome/browser/views/location_bar_view.h +++ b/chrome/browser/views/location_bar_view.h @@ -432,6 +432,7 @@ class LocationBarView : public LocationBar, // Overridden from view. virtual void OnMouseMoved(const views::MouseEvent& event); virtual bool OnMousePressed(const views::MouseEvent& event); + virtual void OnMouseReleased(const views::MouseEvent& event, bool canceled); // Overridden from LocationBarImageView. virtual void ShowInfoBubble(); |