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

Issue 211493009: Ensure that extension resources are loaded with the correct scaling applied on Windows. (Closed)

Created:
6 years, 9 months ago by ananta
Modified:
6 years, 8 months ago
Reviewers:
benwells, sky
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org, benwells
Visibility:
Public.

Description

Ensure that extension resources are loaded with the correct scaling applied on Windows. We were loading the icons with the scaling factor based on the loaded resource pak, which works on all platforms except on Windows with high dpi enabled with dpi settings other than 100% or 200%. Fix is to pass in the correct scaling factor when loading these resources like icons etc which ensures that they get resized correctly. I made the PlatformGetImageScale function in the ResourceBundle class static and passed in the loaded scale factor to it. This function returns the correct scale to be used as before. We call this function from the extensions resource loading code. There may be other places which need similar fixes. Will address those in upcoming CL's BUG=351170, 354706 R=sky@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=260254

Patch Set 1 #

Patch Set 2 : Reverted DCHECK #

Patch Set 3 : Fix try server errors #

Total comments: 2

Patch Set 4 : Moved the scale factor determining code to GetImageScale #

Patch Set 5 : Removed unnecessary include #

Total comments: 2

Patch Set 6 : Removed the GetImageScaleForScaleFactor function #

Total comments: 2

Patch Set 7 : Code review comments #

Patch Set 8 : #

Patch Set 9 : Fixed Compositing browser tests high dpi #

Unified diffs Side-by-side diffs Delta from patch set Stats (+27 lines, -28 lines) Patch
M content/browser/renderer_host/render_widget_host_view_browsertest.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M ui/base/layout.h View 1 2 3 4 5 6 7 2 chunks +5 lines, -1 line 0 comments Download
M ui/base/layout.cc View 1 2 3 4 5 6 4 chunks +11 lines, -2 lines 0 comments Download
M ui/base/resource/resource_bundle.h View 1 2 3 1 chunk +0 lines, -5 lines 0 comments Download
M ui/base/resource/resource_bundle.cc View 1 2 3 4 5 6 4 chunks +10 lines, -13 lines 0 comments Download
M ui/base/resource/resource_bundle_win.cc View 1 2 3 1 chunk +0 lines, -6 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
ananta
sky for overall review. benwells for extensions
6 years, 9 months ago (2014-03-26 02:46:48 UTC) #1
sky
It is possible to move this implementation into ui::GetImageScale? https://codereview.chromium.org/211493009/diff/60001/ui/base/resource/resource_bundle.h File ui/base/resource/resource_bundle.h (right): https://codereview.chromium.org/211493009/diff/60001/ui/base/resource/resource_bundle.h#newcode263 ui/base/resource/resource_bundle.h:263: ...
6 years, 9 months ago (2014-03-26 13:45:37 UTC) #2
sky
That should be, 'is it possible'.
6 years, 9 months ago (2014-03-26 13:45:48 UTC) #3
ananta
https://codereview.chromium.org/211493009/diff/60001/ui/base/resource/resource_bundle.h File ui/base/resource/resource_bundle.h (right): https://codereview.chromium.org/211493009/diff/60001/ui/base/resource/resource_bundle.h#newcode263 ui/base/resource/resource_bundle.h:263: static float PlatformGetImageScale(ui::ScaleFactor scale_factor); On 2014/03/26 13:45:37, sky wrote: ...
6 years, 9 months ago (2014-03-26 19:40:09 UTC) #4
sky
https://codereview.chromium.org/211493009/diff/130001/ui/base/layout.cc File ui/base/layout.cc (right): https://codereview.chromium.org/211493009/diff/130001/ui/base/layout.cc#newcode121 ui/base/layout.cc:121: return kScaleFactorScales[scale_factor]; Is it possible to make this private ...
6 years, 9 months ago (2014-03-26 20:43:26 UTC) #5
ananta
https://codereview.chromium.org/211493009/diff/130001/ui/base/layout.cc File ui/base/layout.cc (right): https://codereview.chromium.org/211493009/diff/130001/ui/base/layout.cc#newcode121 ui/base/layout.cc:121: return kScaleFactorScales[scale_factor]; On 2014/03/26 20:43:27, sky wrote: > Is ...
6 years, 9 months ago (2014-03-26 21:49:26 UTC) #6
benwells
There are no extensions changes now so removing myself as reviewer :)
6 years, 9 months ago (2014-03-27 02:01:59 UTC) #7
sky
https://codereview.chromium.org/211493009/diff/140001/ui/base/layout.h File ui/base/layout.h (right): https://codereview.chromium.org/211493009/diff/140001/ui/base/layout.h#newcode51 ui/base/layout.h:51: extern float g_kScaleFactorScales[NUM_SCALE_FACTORS]; I don't like exposing this. For ...
6 years, 8 months ago (2014-03-27 15:43:06 UTC) #8
ananta
https://codereview.chromium.org/211493009/diff/140001/ui/base/layout.h File ui/base/layout.h (right): https://codereview.chromium.org/211493009/diff/140001/ui/base/layout.h#newcode51 ui/base/layout.h:51: extern float g_kScaleFactorScales[NUM_SCALE_FACTORS]; On 2014/03/27 15:43:07, sky wrote: > ...
6 years, 8 months ago (2014-03-27 19:05:07 UTC) #9
sky
LGTM
6 years, 8 months ago (2014-03-27 19:42:36 UTC) #10
ananta
6 years, 8 months ago (2014-03-28 20:27:23 UTC) #11
Message was sent while issue was closed.
Committed patchset #9 manually as r260254 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698