diff options
author | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-31 19:18:10 +0000 |
---|---|---|
committer | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-31 19:18:10 +0000 |
commit | 1e87b102a763434fff723a3892469673de22d800 (patch) | |
tree | 630b9116d891acef60cb7f8408726462102ce9a8 /chrome/browser/browser_theme_pack.cc | |
parent | 4619f43b31986bc4432e56909357503593b4a292 (diff) | |
download | chromium_src-1e87b102a763434fff723a3892469673de22d800.zip chromium_src-1e87b102a763434fff723a3892469673de22d800.tar.gz chromium_src-1e87b102a763434fff723a3892469673de22d800.tar.bz2 |
BrowserThemePack: Adds persistant ids for the reload endcaps.
This makes the new reload button tinted when themed.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/1601002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43248 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_theme_pack.cc')
-rw-r--r-- | chrome/browser/browser_theme_pack.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/chrome/browser/browser_theme_pack.cc b/chrome/browser/browser_theme_pack.cc index 5f6ca25..d61daab 100644 --- a/chrome/browser/browser_theme_pack.cc +++ b/chrome/browser/browser_theme_pack.cc @@ -34,7 +34,7 @@ namespace { // Version number of the current theme pack. We just throw out and rebuild // theme packs that aren't int-equal to this. -const int kThemePackVersion = 4; +const int kThemePackVersion = 5; // IDs that are in the DataPack won't clash with the positive integer // int32_t. kHeaderID should always have the maximum value because we want the @@ -166,7 +166,13 @@ PersistingImagesTable kPersistingImages[] = { { 56, IDR_THROBBER, NULL }, { 57, IDR_THROBBER_WAITING, NULL }, { 58, IDR_THROBBER_LIGHT, NULL }, - { 59, IDR_LOCATIONBG, NULL } + { 59, IDR_LOCATIONBG, NULL }, + + { 60, IDR_RELOAD_NOBORDER, NULL }, + { 61, IDR_RELOAD_NOBORDER_CENTER, NULL }, + { 62, IDR_RELOAD_ENDCAP, NULL }, + { 63, IDR_RELOAD_ENDCAP_H, NULL }, + { 64, IDR_RELOAD_ENDCAP_P, NULL } }; int GetPersistentIDByName(const std::string& key) { @@ -515,6 +521,8 @@ bool BrowserThemePack::GetDisplayProperty(int id, int* result) const { SkBitmap* BrowserThemePack::GetBitmapNamed(int idr_id) const { int prs_id = GetPersistentIDByIDR(idr_id); + if (prs_id == -1) + return NULL; // Check our cache of prepared images, first. ImageCache::const_iterator image_iter = prepared_images_.find(prs_id); @@ -964,8 +972,7 @@ void BrowserThemePack::GenerateTintedButtons( for (std::set<int>::const_iterator it = idr_ids.begin(); it != idr_ids.end(); ++it) { int prs_id = GetPersistentIDByIDR(*it); - if (prs_id < 0) - continue; + DCHECK(prs_id > 0); // Fetch the image by IDR... scoped_ptr<SkBitmap> button(new SkBitmap(*rb.GetBitmapNamed(*it))); |