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

Unified Diff: chrome/browser/ui/webui/theme_source.cc

Issue 1492423003: Rejigger ThemeService: move exposure of ThemeProvider interface to a (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add a test Created 5 years 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
Index: chrome/browser/ui/webui/theme_source.cc
diff --git a/chrome/browser/ui/webui/theme_source.cc b/chrome/browser/ui/webui/theme_source.cc
index 6ea356924d9b275eccf7be1839e58fde8e21cb61..671ff0c84f18873dbcf28c5068536d0ffe2670c6 100644
--- a/chrome/browser/ui/webui/theme_source.cc
+++ b/chrome/browser/ui/webui/theme_source.cc
@@ -206,11 +206,11 @@ void ThemeSource::SendThemeBitmap(
ui::GetSupportedScaleFactor(scale_factor);
if (BrowserThemePack::IsPersistentImageID(resource_id)) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- ui::ThemeProvider* tp = ThemeServiceFactory::GetForProfile(profile_);
- DCHECK(tp);
+ const ui::ThemeProvider& tp =
+ ThemeService::GetThemeProviderForProfile(profile_);
pkotwicz 2015/12/04 23:16:50 This looks like its always the non-OTR profile. Se
Evan Stade 2015/12/09 00:57:11 yes, but GetRawData doesn't change for incognito y
scoped_refptr<base::RefCountedMemory> image_data(
- tp->GetRawData(resource_id, resource_scale_factor));
+ tp.GetRawData(resource_id, resource_scale_factor));
callback.Run(image_data.get());
} else {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
@@ -240,10 +240,9 @@ void ThemeSource::SendThemeImage(
scoped_refptr<base::RefCountedBytes> data(new base::RefCountedBytes());
if (BrowserThemePack::IsPersistentImageID(resource_id)) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- ui::ThemeProvider* tp = ThemeServiceFactory::GetForProfile(profile_);
- DCHECK(tp);
-
- ProcessImageOnUIThread(*tp->GetImageSkiaNamed(resource_id), scale_factor,
+ const ui::ThemeProvider& tp =
+ ThemeService::GetThemeProviderForProfile(profile_);
+ ProcessImageOnUIThread(*tp.GetImageSkiaNamed(resource_id), scale_factor,
data);
callback.Run(data.get());
} else {

Powered by Google App Engine
This is Rietveld 408576698