Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Unified Diff: chrome/browser/browser_theme_provider.cc

Issue 159891: Make the DOMUIThemeSource load and pass through a PNG, rather than relying on... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/browser_theme_provider.h ('k') | chrome/browser/dom_ui/dom_ui_theme_source.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_theme_provider.cc
===================================================================
--- chrome/browser/browser_theme_provider.cc (revision 22426)
+++ chrome/browser/browser_theme_provider.cc (working copy)
@@ -353,6 +353,22 @@
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 @@
SetColorData(extension->GetThemeColors());
SetTintData(extension->GetThemeTints());
SetDisplayPropertyData(extension->GetThemeDisplayProperties());
+ raw_data_.clear();
GenerateFrameColors();
GenerateFrameImages();
GenerateTabImages();
@@ -780,6 +797,7 @@
colors_.clear();
tints_.clear();
display_properties_.clear();
+ raw_data_.clear();
SaveImageData(NULL);
SaveColorData();
« no previous file with comments | « chrome/browser/browser_theme_provider.h ('k') | chrome/browser/dom_ui/dom_ui_theme_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698