| OLD | NEW |
| 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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 void Init(InMenuButtonBackground::ButtonType type) { | 250 void Init(InMenuButtonBackground::ButtonType type) { |
| 251 // An InMenuButton should always be focusable regardless of the platform. | 251 // An InMenuButton should always be focusable regardless of the platform. |
| 252 // Hence we don't use SetFocusForPlatform(). | 252 // Hence we don't use SetFocusForPlatform(). |
| 253 SetFocusBehavior(FocusBehavior::ALWAYS); | 253 SetFocusBehavior(FocusBehavior::ALWAYS); |
| 254 SetHorizontalAlignment(gfx::ALIGN_CENTER); | 254 SetHorizontalAlignment(gfx::ALIGN_CENTER); |
| 255 | 255 |
| 256 in_menu_background_ = new InMenuButtonBackground(type); | 256 in_menu_background_ = new InMenuButtonBackground(type); |
| 257 set_background(in_menu_background_); | 257 set_background(in_menu_background_); |
| 258 SetBorder( | 258 SetBorder( |
| 259 views::CreateEmptyBorder(0, kHorizontalPadding, 0, kHorizontalPadding)); | 259 views::CreateEmptyBorder(0, kHorizontalPadding, 0, kHorizontalPadding)); |
| 260 SetFontList(MenuConfig::instance().font_list); | 260 label()->SetFontList(MenuConfig::instance().font_list); |
| 261 } | 261 } |
| 262 | 262 |
| 263 void GetAccessibleNodeData(ui::AXNodeData* node_data) override { | 263 void GetAccessibleNodeData(ui::AXNodeData* node_data) override { |
| 264 LabelButton::GetAccessibleNodeData(node_data); | 264 LabelButton::GetAccessibleNodeData(node_data); |
| 265 node_data->role = ui::AX_ROLE_MENU_ITEM; | 265 node_data->role = ui::AX_ROLE_MENU_ITEM; |
| 266 } | 266 } |
| 267 | 267 |
| 268 // views::LabelButton | 268 // views::LabelButton |
| 269 void OnNativeThemeChanged(const ui::NativeTheme* theme) override { | 269 void OnNativeThemeChanged(const ui::NativeTheme* theme) override { |
| 270 if (theme) { | 270 if (theme) { |
| (...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1235 0, | 1235 0, |
| 1236 BookmarkMenuDelegate::SHOW_PERMANENT_FOLDERS, | 1236 BookmarkMenuDelegate::SHOW_PERMANENT_FOLDERS, |
| 1237 BOOKMARK_LAUNCH_LOCATION_APP_MENU); | 1237 BOOKMARK_LAUNCH_LOCATION_APP_MENU); |
| 1238 } | 1238 } |
| 1239 | 1239 |
| 1240 int AppMenu::ModelIndexFromCommandId(int command_id) const { | 1240 int AppMenu::ModelIndexFromCommandId(int command_id) const { |
| 1241 CommandIDToEntry::const_iterator ix = command_id_to_entry_.find(command_id); | 1241 CommandIDToEntry::const_iterator ix = command_id_to_entry_.find(command_id); |
| 1242 DCHECK(ix != command_id_to_entry_.end()); | 1242 DCHECK(ix != command_id_to_entry_.end()); |
| 1243 return ix->second.second; | 1243 return ix->second.second; |
| 1244 } | 1244 } |
| OLD | NEW |