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

Side by Side Diff: ui/views/controls/menu/menu_image_util.cc

Issue 1406613002: For some vector icons, get the size from the vector definition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 7 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
« no previous file with comments | « ui/gfx/paint_vector_icon.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/views/controls/menu/menu_image_util.h" 5 #include "ui/views/controls/menu/menu_image_util.h"
6 6
7 #include "ui/base/material_design/material_design_controller.h" 7 #include "ui/base/material_design/material_design_controller.h"
8 #include "ui/gfx/color_palette.h" 8 #include "ui/gfx/color_palette.h"
9 #include "ui/gfx/paint_vector_icon.h" 9 #include "ui/gfx/paint_vector_icon.h"
10 #include "ui/gfx/vector_icons_public.h" 10 #include "ui/gfx/vector_icons_public.h"
11 11
12 namespace views { 12 namespace views {
13 13
14 gfx::ImageSkia GetMenuCheckImage(SkColor icon_color) { 14 gfx::ImageSkia GetMenuCheckImage(SkColor icon_color) {
15 return gfx::CreateVectorIcon(gfx::VectorIconId::MENU_CHECK, kMenuCheckSize, 15 return gfx::CreateVectorIcon(gfx::VectorIconId::MENU_CHECK, icon_color);
Evan Stade 2016/04/26 16:58:29 In some places we aren't actually getting rid of a
16 icon_color);
17 } 16 }
18 17
19 gfx::ImageSkia GetRadioButtonImage(bool toggled, 18 gfx::ImageSkia GetRadioButtonImage(bool toggled,
20 bool hovered, 19 bool hovered,
21 SkColor default_icon_color) { 20 SkColor default_icon_color) {
22 gfx::VectorIconId id = toggled ? gfx::VectorIconId::MENU_RADIO_SELECTED 21 gfx::VectorIconId id = toggled ? gfx::VectorIconId::MENU_RADIO_SELECTED
23 : gfx::VectorIconId::MENU_RADIO_EMPTY; 22 : gfx::VectorIconId::MENU_RADIO_EMPTY;
24 SkColor color = 23 SkColor color =
25 toggled && !hovered ? gfx::kGoogleBlue500 : default_icon_color; 24 toggled && !hovered ? gfx::kGoogleBlue500 : default_icon_color;
26 return gfx::CreateVectorIcon(id, kMenuCheckSize, color); 25 return gfx::CreateVectorIcon(id, kMenuCheckSize, color);
27 } 26 }
28 27
29 gfx::ImageSkia GetSubmenuArrowImage(SkColor icon_color) { 28 gfx::ImageSkia GetSubmenuArrowImage(SkColor icon_color) {
30 return gfx::CreateVectorIcon(gfx::VectorIconId::SUBMENU_ARROW, 29 return gfx::CreateVectorIcon(gfx::VectorIconId::SUBMENU_ARROW, icon_color);
31 kSubmenuArrowSize, icon_color);
32 } 30 }
33 31
34 } // namespace views 32 } // namespace views
OLDNEW
« no previous file with comments | « ui/gfx/paint_vector_icon.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698