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

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

Issue 1454583002: Change Views menus to consistently use GetNativeTheme for theming. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: get menu config from item Created 5 years, 1 month 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 | « ui/views/controls/menu/menu_controller.h ('k') | ui/views/controls/menu/menu_controller_unittest.cc » ('j') | 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 b3a6adacecfd3197cc01a845b7e06019ed13fdbe..c74484057beff32879419f95d95f5661d4dde10e 100644
--- a/ui/views/controls/menu/menu_controller.cc
+++ b/ui/views/controls/menu/menu_controller.cc
@@ -1217,8 +1217,7 @@ void MenuController::OnKeyDown(ui::KeyboardCode key_code) {
}
}
-MenuController::MenuController(ui::NativeTheme* theme,
- bool blocking,
+MenuController::MenuController(bool blocking,
internal::MenuControllerDelegate* delegate)
: blocking_run_(blocking),
showing_(false),
@@ -1238,7 +1237,6 @@ MenuController::MenuController(ui::NativeTheme* theme,
active_mouse_view_id_(ViewStorage::GetInstance()->CreateStorageID()),
delegate_(delegate),
message_loop_depth_(0),
- menu_config_(theme),
closing_event_time_(base::TimeDelta()),
menu_start_time_(base::TimeTicks()),
is_combobox_(false),
@@ -1733,9 +1731,10 @@ void MenuController::BuildMenuItemPath(MenuItemView* item,
}
void MenuController::StartShowTimer() {
- show_timer_.Start(FROM_HERE,
- TimeDelta::FromMilliseconds(menu_config_.show_delay),
- this, &MenuController::CommitPendingSelection);
+ MenuItemView* item = pending_state_.item ? pending_state_.item : state_.item;
+ show_timer_.Start(
+ FROM_HERE, TimeDelta::FromMilliseconds(item->GetMenuConfig().show_delay),
+ this, &MenuController::CommitPendingSelection);
}
void MenuController::StopShowTimer() {
« no previous file with comments | « ui/views/controls/menu/menu_controller.h ('k') | ui/views/controls/menu/menu_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698