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

Unified Diff: ui/views/controls/menu/menu_controller.cc

Issue 1771863002: Corrects hot-tracked state when space or enter is pressed in a menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/menu/menu_controller.cc
diff --git a/ui/views/controls/menu/menu_controller.cc b/ui/views/controls/menu/menu_controller.cc
index 7526317312ca296b279ea4ceb0a7f860f52fd70f..3bbb0457f661c1ca2b67e4c921fa578b9df7a5d8 100644
--- a/ui/views/controls/menu/menu_controller.cc
+++ b/ui/views/controls/menu/menu_controller.cc
@@ -2638,8 +2638,12 @@ void MenuController::SetInitialHotTrackedView(
}
void MenuController::SetHotTrackedButton(CustomButton* hot_button) {
- if (hot_button == hot_button_)
+ if (hot_button == hot_button_) {
+ // Hot-tracked state may change outside of the MenuController. Correct it.
+ if (hot_button && !hot_button->IsHotTracked())
+ hot_button->SetHotTracked(true);
return;
+ }
if (hot_button_)
hot_button_->SetHotTracked(false);
hot_button_ = hot_button;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698