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

Issue 1025513004: Ensure that the extension icons show up in the omnibox at fractional scales. (Closed)

Created:
5 years, 9 months ago by ananta
Modified:
5 years, 9 months ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Ensure that the extension icons show up in the omnibox at fractional scales. Proposed fix is to discard all unsupported representations (Read fractional scales) in the Extension icon image when the icon is loaded. This ensures that stale caches are invalidated and the correct icons are loaded when the cache is regenerated. BUG=461958 Committed: https://crrev.com/764a6e3d09a5e9043f72db15cca606d4e5467941 Cr-Commit-Position: refs/heads/master@{#322225}

Patch Set 1 #

Patch Set 2 : Fix compile error #

Patch Set 3 : Remove stale representations and add comment #

Total comments: 6

Patch Set 4 : Address oshima review comments #

Total comments: 2

Patch Set 5 : Remove unsupported image scales from the ImageSkia cache when we receive the OnImageLoaded notifica… #

Total comments: 2

Patch Set 6 : Move IsSupportedScale to ui\base\layout.cc/.h #

Total comments: 2

Patch Set 7 : Use g_supported_scale_factors to verify if the scale passed in is supported. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+28 lines, -1 line) Patch
M extensions/browser/extension_icon_image.cc View 1 2 3 4 5 2 chunks +16 lines, -1 line 2 comments Download
M ui/base/layout.h View 1 2 3 4 5 1 chunk +4 lines, -0 lines 0 comments Download
M ui/base/layout.cc View 1 2 3 4 5 6 1 chunk +8 lines, -0 lines 0 comments Download

Messages

Total messages: 37 (10 generated)
ananta
5 years, 9 months ago (2015-03-24 01:03:19 UTC) #2
oshima
https://codereview.chromium.org/1025513004/diff/40001/extensions/browser/extension_icon_image.cc File extensions/browser/extension_icon_image.cc (right): https://codereview.chromium.org/1025513004/diff/40001/extensions/browser/extension_icon_image.cc#newcode228 extensions/browser/extension_icon_image.cc:228: // A better approach might be to set the ...
5 years, 9 months ago (2015-03-24 01:19:05 UTC) #3
oshima
https://codereview.chromium.org/1025513004/diff/40001/extensions/browser/extension_icon_image.cc File extensions/browser/extension_icon_image.cc (right): https://codereview.chromium.org/1025513004/diff/40001/extensions/browser/extension_icon_image.cc#newcode236 extensions/browser/extension_icon_image.cc:236: } actually, you should be able to do: image_skia_ ...
5 years, 9 months ago (2015-03-24 01:22:22 UTC) #4
ananta
https://codereview.chromium.org/1025513004/diff/40001/extensions/browser/extension_icon_image.cc File extensions/browser/extension_icon_image.cc (right): https://codereview.chromium.org/1025513004/diff/40001/extensions/browser/extension_icon_image.cc#newcode228 extensions/browser/extension_icon_image.cc:228: // A better approach might be to set the ...
5 years, 9 months ago (2015-03-24 02:12:23 UTC) #5
ananta
On 2015/03/24 02:12:23, ananta wrote: > https://codereview.chromium.org/1025513004/diff/40001/extensions/browser/extension_icon_image.cc > File extensions/browser/extension_icon_image.cc (right): > > https://codereview.chromium.org/1025513004/diff/40001/extensions/browser/extension_icon_image.cc#newcode228 > ...
5 years, 9 months ago (2015-03-24 21:41:19 UTC) #6
ananta
5 years, 9 months ago (2015-03-24 21:42:05 UTC) #7
pkotwicz
https://codereview.chromium.org/1025513004/diff/60001/extensions/browser/extension_icon_image.cc File extensions/browser/extension_icon_image.cc (right): https://codereview.chromium.org/1025513004/diff/60001/extensions/browser/extension_icon_image.cc#newcode234 extensions/browser/extension_icon_image.cc:234: image_skia_ = gfx::ImageSkia(); Drive by: Why don't you use ...
5 years, 9 months ago (2015-03-24 21:43:08 UTC) #8
ananta
https://codereview.chromium.org/1025513004/diff/60001/extensions/browser/extension_icon_image.cc File extensions/browser/extension_icon_image.cc (right): https://codereview.chromium.org/1025513004/diff/60001/extensions/browser/extension_icon_image.cc#newcode234 extensions/browser/extension_icon_image.cc:234: image_skia_ = gfx::ImageSkia(); On 2015/03/24 21:43:08, pkotwicz wrote: > ...
5 years, 9 months ago (2015-03-24 21:50:39 UTC) #9
oshima
https://codereview.chromium.org/1025513004/diff/80001/ui/gfx/image/image_skia.cc File ui/gfx/image/image_skia.cc (right): https://codereview.chromium.org/1025513004/diff/80001/ui/gfx/image/image_skia.cc#newcode321 ui/gfx/image/image_skia.cc:321: bool ImageSkia::IsSupportedScale(float scale) { can you move this to ...
5 years, 9 months ago (2015-03-24 21:57:02 UTC) #10
ananta
https://codereview.chromium.org/1025513004/diff/80001/ui/gfx/image/image_skia.cc File ui/gfx/image/image_skia.cc (right): https://codereview.chromium.org/1025513004/diff/80001/ui/gfx/image/image_skia.cc#newcode321 ui/gfx/image/image_skia.cc:321: bool ImageSkia::IsSupportedScale(float scale) { On 2015/03/24 21:57:01, oshima wrote: ...
5 years, 9 months ago (2015-03-24 23:11:57 UTC) #11
oshima
lgtm
5 years, 9 months ago (2015-03-24 23:49:52 UTC) #12
pkotwicz1
I will take Oshima's word. It would be nice if users of ImageSkia::AddRepresentation() did not ...
5 years, 9 months ago (2015-03-25 00:11:58 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1025513004/100001
5 years, 9 months ago (2015-03-25 00:36:52 UTC) #15
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/51732)
5 years, 9 months ago (2015-03-25 00:44:40 UTC) #17
ananta
+yoz for extensions owners
5 years, 9 months ago (2015-03-25 00:47:44 UTC) #19
Yoyo Zhou
LGTM for extensions
5 years, 9 months ago (2015-03-25 00:57:00 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1025513004/100001
5 years, 9 months ago (2015-03-25 01:56:15 UTC) #22
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/51742)
5 years, 9 months ago (2015-03-25 02:04:40 UTC) #24
ananta
+sky for ui/base owners
5 years, 9 months ago (2015-03-25 03:05:30 UTC) #26
sky
https://codereview.chromium.org/1025513004/diff/100001/ui/base/layout.cc File ui/base/layout.cc (right): https://codereview.chromium.org/1025513004/diff/100001/ui/base/layout.cc#newcode97 ui/base/layout.cc:97: gfx::ImageSkia::GetSupportedScales(); Why are you using ImageSkia and not g_supported_scale_factors?
5 years, 9 months ago (2015-03-25 14:49:10 UTC) #27
ananta
https://codereview.chromium.org/1025513004/diff/100001/ui/base/layout.cc File ui/base/layout.cc (right): https://codereview.chromium.org/1025513004/diff/100001/ui/base/layout.cc#newcode97 ui/base/layout.cc:97: gfx::ImageSkia::GetSupportedScales(); On 2015/03/25 14:49:10, sky wrote: > Why are ...
5 years, 9 months ago (2015-03-25 16:56:05 UTC) #28
sky
LGTM
5 years, 9 months ago (2015-03-25 19:41:00 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1025513004/120001
5 years, 9 months ago (2015-03-25 19:50:13 UTC) #32
commit-bot: I haz the power
Committed patchset #7 (id:120001)
5 years, 9 months ago (2015-03-25 20:04:38 UTC) #33
commit-bot: I haz the power
Patchset 7 (id:??) landed as https://crrev.com/764a6e3d09a5e9043f72db15cca606d4e5467941 Cr-Commit-Position: refs/heads/master@{#322225}
5 years, 9 months ago (2015-03-25 20:05:06 UTC) #34
brucedawson
Minor variable declaration suggestion from /analyze warning. https://codereview.chromium.org/1025513004/diff/120001/extensions/browser/extension_icon_image.cc File extensions/browser/extension_icon_image.cc (right): https://codereview.chromium.org/1025513004/diff/120001/extensions/browser/extension_icon_image.cc#newcode237 extensions/browser/extension_icon_image.cc:237: for (const ...
5 years, 9 months ago (2015-03-26 18:44:38 UTC) #36
ananta
5 years, 9 months ago (2015-03-26 18:48:20 UTC) #37
Message was sent while issue was closed.
https://codereview.chromium.org/1025513004/diff/120001/extensions/browser/ext...
File extensions/browser/extension_icon_image.cc (right):

https://codereview.chromium.org/1025513004/diff/120001/extensions/browser/ext...
extensions/browser/extension_icon_image.cc:237: for (const auto rep : reps) {
On 2015/03/26 18:44:37, brucedawson wrote:
> The declaration of 'rep' should, I believe, be "const auto& rep" in order to
> avoid a gratuitous copy of the ImageSkiaRep object. The copy isn't super
> expensive, but still probably worth avoiding.
> 
> Also, 'rep' shadows the same-named variable in the outer scope. This isn't a
bug
> but it can lead to confusion about which variable was intended. Consider
> renaming the inner 'rep'? I noticed this because of a new variable shadowing
> warning from /analyze.

Will address these in a followup

Thanks
Ananta

Powered by Google App Engine
This is Rietveld 408576698