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

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

Issue 2523673004: [NOT FOR COMMIT] Fully replace SkCanvas uses.
Patch Set: Support Android build. Created 4 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 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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_strip.cc ('k') | chrome/renderer/pepper/pepper_flash_renderer_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698