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 "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "grit/ui_resources.h" | 9 #include "grit/ui_resources.h" |
10 #include "third_party/skia/include/effects/SkGradientShader.h" | 10 #include "third_party/skia/include/effects/SkGradientShader.h" |
11 #include "ui/base/resource/resource_bundle.h" | 11 #include "ui/base/resource/resource_bundle.h" |
12 #include "ui/gfx/canvas.h" | 12 #include "ui/gfx/canvas.h" |
| 13 #include "ui/gfx/geometry/point.h" |
13 #include "ui/gfx/image/canvas_image_source.h" | 14 #include "ui/gfx/image/canvas_image_source.h" |
14 #include "ui/gfx/image/image.h" | 15 #include "ui/gfx/image/image.h" |
15 #include "ui/gfx/image/image_skia.h" | 16 #include "ui/gfx/image/image_skia.h" |
16 #include "ui/gfx/image/image_skia_source.h" | 17 #include "ui/gfx/image/image_skia_source.h" |
17 #include "ui/gfx/point.h" | |
18 #include "ui/gfx/size.h" | 18 #include "ui/gfx/size.h" |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 // Size of the radio button inciator. | 22 // Size of the radio button inciator. |
23 const int kSelectedIndicatorSize = 5; | 23 const int kSelectedIndicatorSize = 5; |
24 const int kIndicatorSize = 10; | 24 const int kIndicatorSize = 10; |
25 | 25 |
26 // Used for the radio indicator. See theme_draw for details. | 26 // Used for the radio indicator. See theme_draw for details. |
27 const double kGradientStop = .5; | 27 const double kGradientStop = .5; |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 int image_id = selected ? IDR_MENU_RADIO_SELECTED : IDR_MENU_RADIO_EMPTY; | 160 int image_id = selected ? IDR_MENU_RADIO_SELECTED : IDR_MENU_RADIO_EMPTY; |
161 return ui::ResourceBundle::GetSharedInstance().GetImageNamed(image_id). | 161 return ui::ResourceBundle::GetSharedInstance().GetImageNamed(image_id). |
162 AsImageSkia(); | 162 AsImageSkia(); |
163 } | 163 } |
164 | 164 |
165 gfx::ImageSkia GetSubmenuArrowImage(bool dark_background) { | 165 gfx::ImageSkia GetSubmenuArrowImage(bool dark_background) { |
166 return GetRtlSubmenuArrowImage(base::i18n::IsRTL(), dark_background); | 166 return GetRtlSubmenuArrowImage(base::i18n::IsRTL(), dark_background); |
167 } | 167 } |
168 | 168 |
169 } // namespace views | 169 } // namespace views |
OLD | NEW |