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

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

Issue 2627353002: Create vector icon directory for resources used by controls in ui/views. (Closed)
Patch Set: fix win? Created 3 years, 11 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/views/controls/button/radio_button.cc ('k') | ui/views/resources/vector_icons/BUILD.gn » ('j') | 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_icon_types.h"
11 #include "ui/views/resources/vector_icons/vector_icons.h"
11 12
12 namespace views { 13 namespace views {
13 14
14 gfx::ImageSkia GetMenuCheckImage(SkColor icon_color) { 15 gfx::ImageSkia GetMenuCheckImage(SkColor icon_color) {
15 return gfx::CreateVectorIcon(gfx::VectorIconId::MENU_CHECK, icon_color); 16 return gfx::CreateVectorIcon(kMenuCheckIcon, icon_color);
16 } 17 }
17 18
18 gfx::ImageSkia GetRadioButtonImage(bool toggled, 19 gfx::ImageSkia GetRadioButtonImage(bool toggled,
19 bool hovered, 20 bool hovered,
20 SkColor default_icon_color) { 21 SkColor default_icon_color) {
21 gfx::VectorIconId id = toggled ? gfx::VectorIconId::MENU_RADIO_SELECTED 22 const gfx::VectorIcon& icon =
22 : gfx::VectorIconId::MENU_RADIO_EMPTY; 23 toggled ? kMenuRadioSelectedIcon : kMenuRadioEmptyIcon;
23 SkColor color = 24 SkColor color =
24 toggled && !hovered ? gfx::kGoogleBlue500 : default_icon_color; 25 toggled && !hovered ? gfx::kGoogleBlue500 : default_icon_color;
25 return gfx::CreateVectorIcon(id, kMenuCheckSize, color); 26 return gfx::CreateVectorIcon(icon, kMenuCheckSize, color);
26 } 27 }
27 28
28 gfx::ImageSkia GetSubmenuArrowImage(SkColor icon_color) { 29 gfx::ImageSkia GetSubmenuArrowImage(SkColor icon_color) {
29 return gfx::CreateVectorIcon(gfx::VectorIconId::SUBMENU_ARROW, icon_color); 30 return gfx::CreateVectorIcon(kSubmenuArrowIcon, icon_color);
30 } 31 }
31 32
32 } // namespace views 33 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/radio_button.cc ('k') | ui/views/resources/vector_icons/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698