OLD | NEW |
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/base/resource/resource_bundle.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 #include "ui/views/resources/grit/views_resources.h" | |
12 | 11 |
13 namespace views { | 12 namespace views { |
14 | 13 |
15 gfx::ImageSkia GetMenuCheckImage(SkColor icon_color) { | 14 gfx::ImageSkia GetMenuCheckImage(SkColor icon_color) { |
16 return gfx::CreateVectorIcon(gfx::VectorIconId::MENU_CHECK, kMenuCheckSize, | 15 return gfx::CreateVectorIcon(gfx::VectorIconId::MENU_CHECK, kMenuCheckSize, |
17 icon_color); | 16 icon_color); |
18 } | 17 } |
19 | 18 |
20 gfx::ImageSkia GetRadioButtonImage(bool selected) { | 19 gfx::ImageSkia GetRadioButtonImage(bool toggled, |
21 int image_id = selected ? IDR_MENU_RADIO_SELECTED : IDR_MENU_RADIO_EMPTY; | 20 bool hovered, |
22 return ui::ResourceBundle::GetSharedInstance().GetImageNamed(image_id). | 21 SkColor default_icon_color) { |
23 AsImageSkia(); | 22 gfx::VectorIconId id = toggled ? gfx::VectorIconId::MENU_RADIO_SELECTED |
| 23 : gfx::VectorIconId::MENU_RADIO_EMPTY; |
| 24 SkColor color = |
| 25 toggled && !hovered ? gfx::kGoogleBlue500 : default_icon_color; |
| 26 return gfx::CreateVectorIcon(id, kMenuCheckSize, color); |
24 } | 27 } |
25 | 28 |
26 gfx::ImageSkia GetSubmenuArrowImage(SkColor icon_color) { | 29 gfx::ImageSkia GetSubmenuArrowImage(SkColor icon_color) { |
27 return gfx::CreateVectorIcon(gfx::VectorIconId::SUBMENU_ARROW, | 30 return gfx::CreateVectorIcon(gfx::VectorIconId::SUBMENU_ARROW, |
28 kSubmenuArrowSize, icon_color); | 31 kSubmenuArrowSize, icon_color); |
29 } | 32 } |
30 | 33 |
31 } // namespace views | 34 } // namespace views |
OLD | NEW |