diff options
author | yefim@chromium.org <yefim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-18 06:55:58 +0000 |
---|---|---|
committer | yefim@chromium.org <yefim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-18 06:55:58 +0000 |
commit | cec2dd0b2d786a93d185a606e899fadae188d0ae (patch) | |
tree | 2c924796b0db3ab5af5b636c3c2fd88c4db26f9b /ui/native_theme/common_theme.cc | |
parent | eb72b66c329a1d94320678bcd28db8041f006e5f (diff) | |
download | chromium_src-cec2dd0b2d786a93d185a606e899fadae188d0ae.zip chromium_src-cec2dd0b2d786a93d185a606e899fadae188d0ae.tar.gz chromium_src-cec2dd0b2d786a93d185a606e899fadae188d0ae.tar.bz2 |
Added new menu check and radio button images and related code (images in a separate CL, 11569043).
BUG=157692
Review URL: https://chromiumcodereview.appspot.com/11578039
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173657 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/native_theme/common_theme.cc')
-rw-r--r-- | ui/native_theme/common_theme.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/ui/native_theme/common_theme.cc b/ui/native_theme/common_theme.cc index ba9fe70..a4496a2 100644 --- a/ui/native_theme/common_theme.cc +++ b/ui/native_theme/common_theme.cc @@ -5,7 +5,10 @@ #include "ui/native_theme/common_theme.h" #include "base/logging.h" +#include "grit/ui_resources.h" #include "third_party/skia/include/core/SkCanvas.h" +#include "ui/base/resource/resource_bundle.h" +#include "ui/gfx/image/image_skia.h" #include "ui/gfx/rect.h" #include "ui/gfx/skia_util.h" #include "ui/views/controls/menu/menu_config.h" @@ -53,6 +56,25 @@ bool CommonThemeGetSystemColor(NativeTheme::ColorId color_id, SkColor* color) { return true; } +gfx::Size CommonThemeGetPartSize(NativeTheme::Part part, + NativeTheme::State state, + const NativeTheme::ExtraParams& extra) { + gfx::Size size; + switch (part) { + case NativeTheme::kMenuCheck: { + const gfx::ImageSkia* check = + ui::ResourceBundle::GetSharedInstance().GetImageNamed( + IDR_MENU_CHECK_CHECKED).ToImageSkia(); + size.SetSize(check->width(), check->height()); + break; + } + default: + break; + } + + return size; +} + void CommonThemePaintMenuSeparator( SkCanvas* canvas, const gfx::Rect& rect, |