summaryrefslogtreecommitdiffstats
path: root/chrome/views/base_button.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/views/base_button.cc')
-rw-r--r--chrome/views/base_button.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/chrome/views/base_button.cc b/chrome/views/base_button.cc
index 7fc4772..6424f90 100644
--- a/chrome/views/base_button.cc
+++ b/chrome/views/base_button.cc
@@ -236,6 +236,17 @@ bool BaseButton::OnKeyReleased(const KeyEvent& e) {
return false;
}
+void BaseButton::ShowContextMenu(int x, int y, bool is_mouse_gesture) {
+ if (GetContextMenuController()) {
+ // We're about to show the context menu. Showing the context menu likely
+ // means we won't get a mouse exited and reset state. Reset it now to be
+ // sure.
+ if (GetState() != BS_DISABLED)
+ SetState(BS_NORMAL);
+ View::ShowContextMenu(x, y, is_mouse_gesture);
+ }
+}
+
bool BaseButton::AcceleratorPressed(const Accelerator& accelerator) {
if (enabled_) {
SetState(BS_NORMAL);