diff options
author | rogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-08 18:48:39 +0000 |
---|---|---|
committer | rogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-08 18:48:39 +0000 |
commit | 510b4d6252503218f9cbb48de56149b9fa8e87b2 (patch) | |
tree | 953bd3b4789834c1e8d805efb55003daaf324026 | |
parent | 927752ace237429698de2ee4361f30cfcc7d264d (diff) | |
download | chromium_src-510b4d6252503218f9cbb48de56149b9fa8e87b2.zip chromium_src-510b4d6252503218f9cbb48de56149b9fa8e87b2.tar.gz chromium_src-510b4d6252503218f9cbb48de56149b9fa8e87b2.tar.bz2 |
When the user right-clicks on the new tab button in the tab strip, show the
tab strip context menu.
BUG=81221
TEST=Right click on the new tab button and make sure the context menu appears.
Make sure to click inside the button's irregular shape.
Review URL: http://codereview.chromium.org/8386052
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109061 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/ui/views/tabs/tab_strip.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc index 349ef15..39a1da7 100644 --- a/chrome/browser/ui/views/tabs/tab_strip.cc +++ b/chrome/browser/ui/views/tabs/tab_strip.cc @@ -34,6 +34,7 @@ #include "views/window/non_client_view.h" #if defined(OS_WIN) +#include "ui/base/win/hwnd_util.h" #include "views/widget/monitor_win.h" #endif @@ -114,6 +115,19 @@ class NewTabButton : public views::ImageButton { path->close(); } +#if defined(OS_WIN) && !defined(USE_AURA) + void OnMouseReleased(const views::MouseEvent& event) OVERRIDE { + if (event.IsOnlyRightMouseButton()) { + gfx::Point point(event.x(), event.y()); + views::View::ConvertPointToScreen(this, &point); + ui::ShowSystemMenu(GetWidget()->GetNativeView(), point.x(), point.y()); + SetState(BS_NORMAL); + return; + } + views::ImageButton::OnMouseReleased(event); + } +#endif + private: // Tab strip that contains this button. TabStrip* tab_strip_; |