Chromium Code Reviews| 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..653fd067b8c380e514f1c9f5ae8797389811b9d0 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; |
|
pkotwicz
2014/05/20 03:31:19
Nit: default initialize float
oshima
2014/05/20 18:23:28
Done.
|
| 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)); |
| } |
| } |