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

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

Issue 2880623002: [ash-md] Fixed MenuButton focus appearing after dismissing menus. (Closed)
Patch Set: Reworked solution to use CustomButton::ShouldEnterHoveredState(). 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/controls/button/menu_button_unittest.cc » ('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..3523f93e9ac702b18d4b4989bab76c6fd3a5a6d0 100644
--- a/ui/views/controls/button/menu_button.cc
+++ b/ui/views/controls/button/menu_button.cc
@@ -380,6 +380,7 @@ void MenuButton::IncrementPressedLocked(bool snap_ink_drop_to_activated,
AnimateInkDrop(InkDropState::ACTIVATED, event);
}
SetState(STATE_PRESSED);
+ GetInkDrop()->SetHovered(false);
}
void MenuButton::DecrementPressedLocked() {
@@ -395,6 +396,7 @@ void MenuButton::DecrementPressedLocked() {
should_disable_after_press_ = false;
} else if (ShouldEnterHoveredState()) {
desired_state = STATE_HOVERED;
+ GetInkDrop()->SetHovered(true);
}
SetState(desired_state);
// The widget may be null during shutdown. If so, it doesn't make sense to
« no previous file with comments | « no previous file | ui/views/controls/button/menu_button_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698