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

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

Issue 291733004: Reduce the use of ui::ScaleFactor in webui/favicon (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comments Created 6 years, 7 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/ui/webui/theme_source.h ('k') | chrome/common/favicon/favicon_url_parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 46b9db91e63e2d465a2f8fc31544e70b3bf2b72b..0c60f021c019e68575eb4adc4dc20c97d8b79356 100644
--- a/chrome/browser/ui/webui/theme_source.cc
+++ b/chrome/browser/ui/webui/theme_source.cc
@@ -62,7 +62,7 @@ void ThemeSource::StartDataRequest(
int render_frame_id,
const content::URLDataSource::GotDataCallback& callback) {
// Default scale factor if not specified.
- ui::ScaleFactor scale_factor;
+ float scale_factor = 1.0f;
std::string uncached_path;
webui::ParsePathAndScale(GURL(GetThemePath() + path),
&uncached_path,
@@ -137,18 +137,21 @@ bool ThemeSource::ShouldServiceRequest(const net::URLRequest* request) const {
void ThemeSource::SendThemeBitmap(
const content::URLDataSource::GotDataCallback& callback,
int resource_id,
- ui::ScaleFactor scale_factor) {
+ float scale_factor) {
+ ui::ScaleFactor resource_scale_factor =
+ ui::GetSupportedScaleFactor(scale_factor);
if (ThemeProperties::IsThemeableImage(resource_id)) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
ui::ThemeProvider* tp = ThemeServiceFactory::GetForProfile(profile_);
DCHECK(tp);
- scoped_refptr<base::RefCountedMemory> image_data(tp->GetRawData(
- resource_id, scale_factor));
+ scoped_refptr<base::RefCountedMemory> image_data(
+ tp->GetRawData(resource_id, resource_scale_factor));
callback.Run(image_data.get());
} else {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
const ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- callback.Run(rb.LoadDataResourceBytesForScale(resource_id, scale_factor));
+ callback.Run(
+ rb.LoadDataResourceBytesForScale(resource_id, resource_scale_factor));
}
}
« no previous file with comments | « chrome/browser/ui/webui/theme_source.h ('k') | chrome/common/favicon/favicon_url_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698