| 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));
|
| }
|
| }
|
|
|