|
|
Chromium Code Reviews|
Created:
3 years, 11 months ago by Evan Stade Modified:
3 years, 11 months ago CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionLoad extension icons for more scale factors.
The "supported" scale factors are just the ones that we load raster
assets for (in ResourceBundle). This patch additionally looks for
icons in scale factors that correlate with the currently attached
displays.
Practically speaking, this means a machine that's running at 1.5x such
as a Surface Pro will have better looking extension icons in the
renderer context menu.
BUG=596757
Review-Url: https://codereview.chromium.org/2609853003
Cr-Commit-Position: refs/heads/master@{#444128}
Committed: https://chromium.googlesource.com/chromium/src/+/47ce132c79896db4fe4832a96b097adc643e6e99
Patch Set 1 #
Total comments: 2
Patch Set 2 : test #Patch Set 3 : more floats #
Total comments: 3
Patch Set 4 : more enum->float #Patch Set 5 : fix mac #
Total comments: 3
Patch Set 6 : fix mac? #Patch Set 7 : fix mac? #Patch Set 8 : . #Patch Set 9 : this is so annoying #
Total comments: 2
Patch Set 10 : rebase #
Messages
Total messages: 54 (40 generated)
estade@chromium.org changed reviewers: + oshima@chromium.org, rdevlin.cronin@chromium.org
On 2017/01/03 23:09:31, Evan Stade wrote: This looks okay, but can we add a unittest? Also, do you have screenshots that you can post to the bug for posterity?
https://codereview.chromium.org/2609853003/diff/1/extensions/browser/image_lo... File extensions/browser/image_loader.h (right): https://codereview.chromium.org/2609853003/diff/1/extensions/browser/image_lo... extensions/browser/image_loader.h:90: // Loads and returns a gfx::Image that has representations at all scale And one small nit: this function doesn't return; it calls the callback with the result (this was wrong before, too, but since we're updating the comment anyway it might be worth fixing).
test added. Screenshots aren't very informative beyond what's already posted on the bug. (Despite my previous assertions, I believe comment 2 is actually displaying blurriness at 1.5x, and a screenshot of what it looks like with this patch is just the same but with a smoother looking icon.) https://codereview.chromium.org/2609853003/diff/1/extensions/browser/image_lo... File extensions/browser/image_loader.h (right): https://codereview.chromium.org/2609853003/diff/1/extensions/browser/image_lo... extensions/browser/image_loader.h:90: // Loads and returns a gfx::Image that has representations at all scale On 2017/01/04 15:59:10, Devlin wrote: > And one small nit: this function doesn't return; it calls the callback with the > result (this was wrong before, too, but since we're updating the comment anyway > it might be worth fixing). Done.
The CQ bit was checked by estade@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
Looks like the latest patchset is breaking a bunch of bots; mind updating and re-pinging?
https://codereview.chromium.org/2609853003/diff/40001/extensions/browser/exte... File extensions/browser/extension_icon_image.cc (left): https://codereview.chromium.org/2609853003/diff/40001/extensions/browser/exte... extensions/browser/extension_icon_image.cc:204: scale_factor)); the failure was due to scale_factor being an enum value --- I changed ImageRepresentation's constructor and this was implicitly cast to float. I fixed that and also changed more of the ScaleFactors in this file to be float. Not sure if that's OK, or if there is a reason to use the ScaleFactor enum. Devlin or Oshima, do you know if converting these ScaleFactors to floats is OK?
The CQ bit was checked by estade@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
The CQ bit was checked by estade@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by estade@chromium.org to run a CQ dry run
The CQ bit was checked by estade@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
lgtm % nits https://codereview.chromium.org/2609853003/diff/40001/chrome/browser/extensio... File chrome/browser/extensions/extension_icon_manager_unittest.cc (right): https://codereview.chromium.org/2609853003/diff/40001/chrome/browser/extensio... chrome/browser/extensions/extension_icon_manager_unittest.cc:279: // Now check that the DSFs for active displays are respected. we should say what a dsf is here, since I don't think it's terribly common and isn't referenced anywhere else in this file. https://codereview.chromium.org/2609853003/diff/40001/extensions/browser/exte... File extensions/browser/extension_icon_image.cc (left): https://codereview.chromium.org/2609853003/diff/40001/extensions/browser/exte... extensions/browser/extension_icon_image.cc:204: scale_factor)); On 2017/01/07 01:17:38, Evan Stade wrote: > the failure was due to scale_factor being an enum value --- I changed > ImageRepresentation's constructor and this was implicitly cast to float. > > I fixed that and also changed more of the ScaleFactors in this file to be float. > Not sure if that's OK, or if there is a reason to use the ScaleFactor enum. > Devlin or Oshima, do you know if converting these ScaleFactors to floats is OK? As far as I know, this is fine, but oshima@ might know better. https://codereview.chromium.org/2609853003/diff/80001/chrome/browser/extensio... File chrome/browser/extensions/extension_icon_manager_unittest.cc (right): https://codereview.chromium.org/2609853003/diff/80001/chrome/browser/extensio... chrome/browser/extensions/extension_icon_manager_unittest.cc:274: else if (ui::IsSupportedScale(scale)) if it's *not* a supported scale, can we assert that we don't have a representation (since presumably we don't have a screen here)?
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
The CQ bit was checked by estade@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
The CQ bit was checked by estade@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
The CQ bit was checked by estade@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
The CQ bit was checked by estade@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
finally got it all green, ptal
s lgtm https://codereview.chromium.org/2609853003/diff/80001/chrome/browser/extensio... File chrome/browser/extensions/extension_icon_manager_unittest.cc (right): https://codereview.chromium.org/2609853003/diff/80001/chrome/browser/extensio... chrome/browser/extensions/extension_icon_manager_unittest.cc:274: else if (ui::IsSupportedScale(scale)) On 2017/01/09 21:58:33, Devlin wrote: > if it's *not* a supported scale, can we assert that we don't have a > representation (since presumably we don't have a screen here)? ping on this one https://codereview.chromium.org/2609853003/diff/160001/chrome/browser/extensi... File chrome/browser/extensions/extension_icon_manager_unittest.cc (right): https://codereview.chromium.org/2609853003/diff/160001/chrome/browser/extensi... chrome/browser/extensions/extension_icon_manager_unittest.cc:56: base::test::ScopedCommandLine cl_; nitty nit: style discourages abbreviation in variable names. [1] Maybe just command_line_ or scoped_command_line_? [1] https://google.github.io/styleguide/cppguide.html#General_Naming_Rules
estade@chromium.org changed reviewers: + derat@chromium.org
+derat for one line change in ui/display https://codereview.chromium.org/2609853003/diff/80001/chrome/browser/extensio... File chrome/browser/extensions/extension_icon_manager_unittest.cc (right): https://codereview.chromium.org/2609853003/diff/80001/chrome/browser/extensio... chrome/browser/extensions/extension_icon_manager_unittest.cc:274: else if (ui::IsSupportedScale(scale)) On 2017/01/13 15:53:47, Devlin (possibly slow) wrote: > On 2017/01/09 21:58:33, Devlin wrote: > > if it's *not* a supported scale, can we assert that we don't have a > > representation (since presumably we don't have a screen here)? > > ping on this one sorry for not responding. I reverted this change.
The CQ bit was checked by estade@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
lgtm for ui/display
https://codereview.chromium.org/2609853003/diff/160001/chrome/browser/extensi... File chrome/browser/extensions/extension_icon_manager_unittest.cc (right): https://codereview.chromium.org/2609853003/diff/160001/chrome/browser/extensi... chrome/browser/extensions/extension_icon_manager_unittest.cc:56: base::test::ScopedCommandLine cl_; On 2017/01/13 15:53:48, Devlin (possibly slow) wrote: > nitty nit: style discourages abbreviation in variable names. [1] Maybe just > command_line_ or scoped_command_line_? > > [1] https://google.github.io/styleguide/cppguide.html#General_Naming_Rules Done.
The CQ bit was unchecked by estade@chromium.org
The CQ bit was checked by estade@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from rdevlin.cronin@chromium.org Link to the patchset: https://codereview.chromium.org/2609853003/#ps180001 (title: "rebase")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch.
Bot data: {"patchset_id": 180001, "attempt_start_ts": 1484683277291860,
"parent_rev": "cd451bb0505aff90663e653d7a27b1f33ebcb6ba", "commit_rev":
"47ce132c79896db4fe4832a96b097adc643e6e99"}
Message was sent while issue was closed.
Description was changed from ========== Load extension icons for more scale factors. The "supported" scale factors are just the ones that we load raster assets for (in ResourceBundle). This patch additionally looks for icons in scale factors that correlate with the currently attached displays. Practically speaking, this means a machine that's running at 1.5x such as a Surface Pro will have better looking extension icons in the renderer context menu. BUG=596757 ========== to ========== Load extension icons for more scale factors. The "supported" scale factors are just the ones that we load raster assets for (in ResourceBundle). This patch additionally looks for icons in scale factors that correlate with the currently attached displays. Practically speaking, this means a machine that's running at 1.5x such as a Surface Pro will have better looking extension icons in the renderer context menu. BUG=596757 Review-Url: https://codereview.chromium.org/2609853003 Cr-Commit-Position: refs/heads/master@{#444128} Committed: https://chromium.googlesource.com/chromium/src/+/47ce132c79896db4fe4832a96b09... ==========
Message was sent while issue was closed.
Committed patchset #10 (id:180001) as https://chromium.googlesource.com/chromium/src/+/47ce132c79896db4fe4832a96b09... |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
