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

Side by Side Diff: chrome/browser/ui/views/toolbar/app_menu.cc

Issue 2801583002: Use views::style for buttons, bootstrap ash_typography to do so. (Closed)
Patch Set: rebase for epic ash file move Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/toolbar/app_menu.h" 5 #include "chrome/browser/ui/views/toolbar/app_menu.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cmath> 10 #include <cmath>
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 void Init(InMenuButtonBackground::ButtonType type) { 258 void Init(InMenuButtonBackground::ButtonType type) {
259 // An InMenuButton should always be focusable regardless of the platform. 259 // An InMenuButton should always be focusable regardless of the platform.
260 // Hence we don't use SetFocusForPlatform(). 260 // Hence we don't use SetFocusForPlatform().
261 SetFocusBehavior(FocusBehavior::ALWAYS); 261 SetFocusBehavior(FocusBehavior::ALWAYS);
262 SetHorizontalAlignment(gfx::ALIGN_CENTER); 262 SetHorizontalAlignment(gfx::ALIGN_CENTER);
263 263
264 in_menu_background_ = new InMenuButtonBackground(type); 264 in_menu_background_ = new InMenuButtonBackground(type);
265 set_background(in_menu_background_); 265 set_background(in_menu_background_);
266 SetBorder( 266 SetBorder(
267 views::CreateEmptyBorder(0, kHorizontalPadding, 0, kHorizontalPadding)); 267 views::CreateEmptyBorder(0, kHorizontalPadding, 0, kHorizontalPadding));
268 SetFontList(MenuConfig::instance().font_list); 268 label()->SetFontList(MenuConfig::instance().font_list);
269 } 269 }
270 270
271 void GetAccessibleNodeData(ui::AXNodeData* node_data) override { 271 void GetAccessibleNodeData(ui::AXNodeData* node_data) override {
272 LabelButton::GetAccessibleNodeData(node_data); 272 LabelButton::GetAccessibleNodeData(node_data);
273 node_data->role = ui::AX_ROLE_MENU_ITEM; 273 node_data->role = ui::AX_ROLE_MENU_ITEM;
274 } 274 }
275 275
276 // views::LabelButton 276 // views::LabelButton
277 void OnNativeThemeChanged(const ui::NativeTheme* theme) override { 277 void OnNativeThemeChanged(const ui::NativeTheme* theme) override {
278 if (theme) { 278 if (theme) {
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after
1236 0, 1236 0,
1237 BookmarkMenuDelegate::SHOW_PERMANENT_FOLDERS, 1237 BookmarkMenuDelegate::SHOW_PERMANENT_FOLDERS,
1238 BOOKMARK_LAUNCH_LOCATION_APP_MENU); 1238 BOOKMARK_LAUNCH_LOCATION_APP_MENU);
1239 } 1239 }
1240 1240
1241 int AppMenu::ModelIndexFromCommandId(int command_id) const { 1241 int AppMenu::ModelIndexFromCommandId(int command_id) const {
1242 CommandIDToEntry::const_iterator ix = command_id_to_entry_.find(command_id); 1242 CommandIDToEntry::const_iterator ix = command_id_to_entry_.find(command_id);
1243 DCHECK(ix != command_id_to_entry_.end()); 1243 DCHECK(ix != command_id_to_entry_.end());
1244 return ix->second.second; 1244 return ix->second.second;
1245 } 1245 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698