summaryrefslogtreecommitdiffstats
path: root/chrome/browser/page_info_model.cc
diff options
context:
space:
mode:
authorrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-05 19:21:41 +0000
committerrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-05 19:21:41 +0000
commitf9cab10c8331d125c6bf31cc43b2a18c2fa2784c (patch)
tree1cf11ee77f4e8741767576171e5a6d6525a9ab09 /chrome/browser/page_info_model.cc
parentaea5a7cf666f0c7077833fb33a255df21b9f9a00 (diff)
downloadchromium_src-f9cab10c8331d125c6bf31cc43b2a18c2fa2784c.zip
chromium_src-f9cab10c8331d125c6bf31cc43b2a18c2fa2784c.tar.gz
chromium_src-f9cab10c8331d125c6bf31cc43b2a18c2fa2784c.tar.bz2
Define gfx::NativeImage and add ResourceBundle::GetNativeImageNamed().
BUG=none TEST=compile Review URL: http://codereview.chromium.org/3597008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61545 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/page_info_model.cc')
-rw-r--r--chrome/browser/page_info_model.cc14
1 files changed, 5 insertions, 9 deletions
diff --git a/chrome/browser/page_info_model.cc b/chrome/browser/page_info_model.cc
index 2b2e8da..c4e76eb 100644
--- a/chrome/browser/page_info_model.cc
+++ b/chrome/browser/page_info_model.cc
@@ -264,7 +264,7 @@ PageInfoModel::PageInfoModel(Profile* profile,
PageInfoModel::~PageInfoModel() {
#if defined(OS_MACOSX)
// Release the NSImages.
- for (std::vector<ImageType>::iterator it = icons_.begin();
+ for (std::vector<gfx::NativeImage>::iterator it = icons_.begin();
it != icons_.end(); ++it) {
mac_util::NSObjectRelease(*it);
}
@@ -280,7 +280,7 @@ PageInfoModel::SectionInfo PageInfoModel::GetSectionInfo(int index) {
return sections_[index];
}
-PageInfoModel::ImageType PageInfoModel::GetIconImage(SectionStateIcon icon_id) {
+gfx::NativeImage PageInfoModel::GetIconImage(SectionStateIcon icon_id) {
if (icon_id == ICON_NONE)
return NULL;
// TODO(rsesek): Remove once the window is replaced with the bubble.
@@ -359,17 +359,13 @@ void PageInfoModel::Init() {
icons_.push_back(GetBitmapNamed(IDR_PAGEINFO_INFO));
}
-PageInfoModel::ImageType PageInfoModel::GetBitmapNamed(int resource_id) {
+gfx::NativeImage PageInfoModel::GetBitmapNamed(int resource_id) {
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
+ gfx::NativeImage image = rb.GetNativeImageNamed(resource_id);
#if defined(OS_MACOSX)
// Unlike other platforms, the Mac ResourceBundle does not keep a shared image
// cache. These are released in the dtor.
- ImageType image = rb.GetNSImageNamed(resource_id);
mac_util::NSObjectRetain(image);
- return image;
-#elif defined(USE_X11) && !defined(TOOLKIT_VIEWS)
- return rb.GetPixbufNamed(resource_id);
-#else
- return rb.GetBitmapNamed(resource_id);
#endif
+ return image;
}