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

Unified Diff: chrome/browser/dom_ui/dom_ui_theme_source.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.cc ('k') | chrome/browser/dom_ui/dom_ui_theme_source_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/dom_ui/dom_ui_theme_source.cc
===================================================================
--- chrome/browser/dom_ui/dom_ui_theme_source.cc (revision 22426)
+++ chrome/browser/dom_ui/dom_ui_theme_source.cc (working copy)
@@ -155,18 +155,14 @@
ThemeProvider* tp = profile_->GetThemeProvider();
DCHECK(tp);
- SkBitmap* image = tp->GetBitmapNamed(resource_id);
- if (!image || image->empty()) {
+ std::vector<unsigned char> png_bytes;
+ if (tp->GetRawData(resource_id, &png_bytes)) {
+ scoped_refptr<RefCountedBytes> image_data =
+ new RefCountedBytes(png_bytes);
+ SendResponse(request_id, image_data);
+ } else {
SendResponse(request_id, NULL);
- return;
}
-
- std::vector<unsigned char> png_bytes;
- PNGEncoder::EncodeBGRASkBitmap(*image, false, &png_bytes);
-
- scoped_refptr<RefCountedBytes> image_data =
- new RefCountedBytes(png_bytes);
- SendResponse(request_id, image_data);
}
std::string DOMUIThemeSource::GetNewTabBackgroundCSS(bool bar_attached) {
« no previous file with comments | « chrome/browser/browser_theme_provider.cc ('k') | chrome/browser/dom_ui/dom_ui_theme_source_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698