| 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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 const gfx::Rect& bounds, | 212 const gfx::Rect& bounds, |
| 213 views::Button::ButtonState state) const { | 213 views::Button::ButtonState state) const { |
| 214 if (state == views::Button::STATE_HOVERED || | 214 if (state == views::Button::STATE_HOVERED || |
| 215 state == views::Button::STATE_PRESSED) { | 215 state == views::Button::STATE_PRESSED) { |
| 216 ui::NativeTheme::ExtraParams params; | 216 ui::NativeTheme::ExtraParams params; |
| 217 if (type_ == ROUNDED_BUTTON) { | 217 if (type_ == ROUNDED_BUTTON) { |
| 218 // Consistent with a hover corner radius (kInkDropSmallCornerRadius). | 218 // Consistent with a hover corner radius (kInkDropSmallCornerRadius). |
| 219 const int kBackgroundCornerRadius = 2; | 219 const int kBackgroundCornerRadius = 2; |
| 220 params.menu_item.corner_radius = kBackgroundCornerRadius; | 220 params.menu_item.corner_radius = kBackgroundCornerRadius; |
| 221 } | 221 } |
| 222 // TODO(cdl): native theme |
| 223 /* |
| 222 view->GetNativeTheme()->Paint(canvas->sk_canvas(), | 224 view->GetNativeTheme()->Paint(canvas->sk_canvas(), |
| 223 ui::NativeTheme::kMenuItemBackground, | 225 ui::NativeTheme::kMenuItemBackground, |
| 224 ui::NativeTheme::kHovered, bounds, params); | 226 ui::NativeTheme::kHovered, bounds, params); |
| 227 */ |
| 225 } | 228 } |
| 226 } | 229 } |
| 227 | 230 |
| 228 const ButtonType type_; | 231 const ButtonType type_; |
| 229 | 232 |
| 230 DISALLOW_COPY_AND_ASSIGN(InMenuButtonBackground); | 233 DISALLOW_COPY_AND_ASSIGN(InMenuButtonBackground); |
| 231 }; | 234 }; |
| 232 | 235 |
| 233 base::string16 GetAccessibleNameForAppMenuItem(ButtonMenuItemModel* model, | 236 base::string16 GetAccessibleNameForAppMenuItem(ButtonMenuItemModel* model, |
| 234 int item_index, | 237 int item_index, |
| (...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1234 0, | 1237 0, |
| 1235 BookmarkMenuDelegate::SHOW_PERMANENT_FOLDERS, | 1238 BookmarkMenuDelegate::SHOW_PERMANENT_FOLDERS, |
| 1236 BOOKMARK_LAUNCH_LOCATION_APP_MENU); | 1239 BOOKMARK_LAUNCH_LOCATION_APP_MENU); |
| 1237 } | 1240 } |
| 1238 | 1241 |
| 1239 int AppMenu::ModelIndexFromCommandId(int command_id) const { | 1242 int AppMenu::ModelIndexFromCommandId(int command_id) const { |
| 1240 CommandIDToEntry::const_iterator ix = command_id_to_entry_.find(command_id); | 1243 CommandIDToEntry::const_iterator ix = command_id_to_entry_.find(command_id); |
| 1241 DCHECK(ix != command_id_to_entry_.end()); | 1244 DCHECK(ix != command_id_to_entry_.end()); |
| 1242 return ix->second.second; | 1245 return ix->second.second; |
| 1243 } | 1246 } |
| OLD | NEW |