diff options
author | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-05 01:33:36 +0000 |
---|---|---|
committer | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-05 01:33:36 +0000 |
commit | 04a1f975f55a6bd2d73a45f0cec8bb2b8a5a67dd (patch) | |
tree | 6da04673ee580778b5ae4f1d42bae5d83df2ae93 /chrome/browser/browser_theme_provider.cc | |
parent | bec7e3c3e479216d419281af4bf52151101fb6a9 (diff) | |
download | chromium_src-04a1f975f55a6bd2d73a45f0cec8bb2b8a5a67dd.zip chromium_src-04a1f975f55a6bd2d73a45f0cec8bb2b8a5a67dd.tar.gz chromium_src-04a1f975f55a6bd2d73a45f0cec8bb2b8a5a67dd.tar.bz2 |
Make the DOMUIThemeSource load and pass through a PNG, rather than relying on decode/encode.
BUG=18427
TEST=Install a giant theme, load the NNTP, verify that you can type in the omnibox without delay while the page is loading.
Review URL: http://codereview.chromium.org/159891
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22457 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_theme_provider.cc')
-rw-r--r-- | chrome/browser/browser_theme_provider.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/chrome/browser/browser_theme_provider.cc b/chrome/browser/browser_theme_provider.cc index 116b4d8..ac15107 100644 --- a/chrome/browser/browser_theme_provider.cc +++ b/chrome/browser/browser_theme_provider.cc @@ -353,6 +353,22 @@ bool BrowserThemeProvider::HasCustomImage(int id) { return (images_.find(id) != images_.end()); } +bool BrowserThemeProvider::GetRawData(int id, + std::vector<unsigned char>* raw_data) { + if (raw_data_.find(id) != raw_data_.end()) { + *raw_data = raw_data_[id]; + return true; + } + + if (!ReadThemeFileData(id, raw_data)) { + if (!rb_.LoadImageResourceBytes(id, raw_data)) + return false; + } + + raw_data_[id] = *raw_data; + return true; +} + void BrowserThemeProvider::SetTheme(Extension* extension) { // Clear our image cache. ClearCaches(); @@ -364,6 +380,7 @@ void BrowserThemeProvider::SetTheme(Extension* extension) { SetColorData(extension->GetThemeColors()); SetTintData(extension->GetThemeTints()); SetDisplayPropertyData(extension->GetThemeDisplayProperties()); + raw_data_.clear(); GenerateFrameColors(); GenerateFrameImages(); GenerateTabImages(); @@ -780,6 +797,7 @@ void BrowserThemeProvider::ClearAllThemeData() { colors_.clear(); tints_.clear(); display_properties_.clear(); + raw_data_.clear(); SaveImageData(NULL); SaveColorData(); |