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

Unified Diff: chrome/browser/ui/views/toolbar/app_menu.cc

Issue 1477253002: Use a single views::MenuConfig instance for each platform (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add menu_config_android Created 5 years 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
Index: chrome/browser/ui/views/toolbar/app_menu.cc
diff --git a/chrome/browser/ui/views/toolbar/app_menu.cc b/chrome/browser/ui/views/toolbar/app_menu.cc
index 3b920e7db3936ab6bff0d22fa52e1dbc5e4904fc..cd65d6aebf38a3079cb4d641bd89dffb7b951a05 100644
--- a/chrome/browser/ui/views/toolbar/app_menu.cc
+++ b/chrome/browser/ui/views/toolbar/app_menu.cc
@@ -272,6 +272,7 @@ class InMenuButton : public LabelButton {
set_background(in_menu_background_);
SetBorder(views::Border::CreateEmptyBorder(0, kHorizontalPadding, 0,
kHorizontalPadding));
+ SetFontList(MenuConfig::instance().font_list);
}
void SetOtherButtons(const InMenuButton* left, const InMenuButton* right) {
@@ -280,9 +281,6 @@ class InMenuButton : public LabelButton {
// views::LabelButton
void OnNativeThemeChanged(const ui::NativeTheme* theme) override {
- const MenuConfig& menu_config = MenuConfig::instance(theme);
- SetFontList(menu_config.font_list);
-
if (theme) {
SetTextColor(
views::Button::STATE_DISABLED,
@@ -596,10 +594,9 @@ class AppMenu::ZoomView : public AppMenuView {
void OnNativeThemeChanged(const ui::NativeTheme* theme) override {
AppMenuView::OnNativeThemeChanged(theme);
- const MenuConfig& menu_config = MenuConfig::instance(theme);
zoom_label_->SetBorder(views::Border::CreateEmptyBorder(
0, kZoomLabelHorizontalPadding, 0, kZoomLabelHorizontalPadding));
- zoom_label_->SetFontList(menu_config.font_list);
+ zoom_label_->SetFontList(MenuConfig::instance().font_list);
zoom_label_max_width_valid_ = false;
if (theme) {
@@ -1115,7 +1112,7 @@ void AppMenu::PopulateMenu(MenuItemView* parent, MenuModel* model) {
if (model->GetCommandIdAt(i) == IDC_EDIT_MENU ||
model->GetCommandIdAt(i) == IDC_ZOOM_MENU) {
- const MenuConfig& config = item->GetMenuConfig();
+ const MenuConfig& config = views::MenuConfig::instance();
int top_margin = config.item_top_margin + config.separator_height / 2;
int bottom_margin =
config.item_bottom_margin + config.separator_height / 2;

Powered by Google App Engine
This is Rietveld 408576698