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

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

Issue 2880623002: [ash-md] Fixed MenuButton focus appearing after dismissing menus. (Closed)
Patch Set: Added check for null Widget. Created 3 years, 7 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 | ui/views/widget/widget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/menu_button.cc
diff --git a/ui/views/controls/button/menu_button.cc b/ui/views/controls/button/menu_button.cc
index af3cd2c3f7d70f71dffd333af148474317cfd354..e6707f3d289a39ab01a71bc36c4bb65d5091d5cd 100644
--- a/ui/views/controls/button/menu_button.cc
+++ b/ui/views/controls/button/menu_button.cc
@@ -401,6 +401,12 @@ void MenuButton::DecrementPressedLocked() {
// try to add an ink drop effect.
if (GetWidget() && state() != STATE_PRESSED)
AnimateInkDrop(InkDropState::DEACTIVATED, nullptr /* event */);
+
+ // The Widget can be null in tests.
+ if (GetWidget()) {
sky 2017/05/14 15:52:25 What about dispatching the event at the time the m
+ // Force MOUSE_ENTER/EXIT events so button hover states are updated.
+ GetWidget()->SynthesizeMouseMoveEvent(true);
+ }
}
}
« no previous file with comments | « no previous file | ui/views/widget/widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698