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

Issue 1261143004: Implement manifest icon downloader (Closed)

Created:
5 years, 4 months ago by Lalit Maganti
Modified:
5 years, 4 months ago
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Implement manifest icon downloader This CL unifies code used by app banners and shortcut helper into one class. It further implements icon scaling which fixes the issue of Intent overflow on Android when there is a bad manifest/only a big icon is provided. It also refactors code for a future CL which will implement downloading of another icon for installed webapps splashscreen on Android. BUG=513666 Committed: https://crrev.com/e109fb09878be947da59c39b5876ae36c187d534 Cr-Commit-Position: refs/heads/master@{#344787}

Patch Set 1 #

Patch Set 2 : Implement downloader algorithm #

Patch Set 3 : Add scaling to non correct icons #

Total comments: 36

Patch Set 4 : Fix issues raised in comments #

Total comments: 30

Patch Set 5 : Fix issues raised in review #

Patch Set 6 : Refactor and add unit tests #

Patch Set 7 : Make ShortcutHelper use icon download class too #

Total comments: 2

Patch Set 8 : Address comments on previous review #

Total comments: 24

Patch Set 9 : Address comments on review #

Total comments: 16

Patch Set 10 : Fix Mounir's comments #

Patch Set 11 : Fix compile #

Patch Set 12 : Fix test failures #

Patch Set 13 : Remove unecessary code #

Patch Set 14 : Fix test failures on Mac #

Patch Set 15 : Fix remaining test failures #

Patch Set 16 : Fix test compile #

Patch Set 17 : Implement lower bound for icons and ignore scaling for smaller icons #

Patch Set 18 : Implement discussed algorithm #

Patch Set 19 : Fix compile #

Total comments: 6

Patch Set 20 : Rework icon downloader code #

Patch Set 21 : Set upstream #

Patch Set 22 : Fix bad file #

Patch Set 23 : Fix compile and test failures #

Patch Set 24 : Move app banner test changes to icon selector cl #

Patch Set 25 : Remove bad file (again) #

Patch Set 26 : Fix algorithm again #

Patch Set 27 : Address silly regressions due to switching between Android <-> Linux #

Total comments: 10

Patch Set 28 : Fix comments on last review #

Patch Set 29 : Rebase #

Total comments: 22

Patch Set 30 : Address review comments #

Patch Set 31 : Rebase #

Patch Set 32 : Fix favicon fallback in add to homescreen helper #

Total comments: 12

Patch Set 33 : Fix review comments #

Total comments: 6

Patch Set 34 : Address comments on review #

Patch Set 35 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+386 lines, -101 lines) Patch
M chrome/browser/android/banners/app_banner_data_fetcher_android.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/android/webapps/add_to_homescreen_data_fetcher.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 1 chunk +3 lines, -7 lines 0 comments Download
M chrome/browser/android/webapps/add_to_homescreen_data_fetcher.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 4 chunks +12 lines, -34 lines 0 comments Download
M chrome/browser/banners/app_banner_data_fetcher.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 6 chunks +6 lines, -8 lines 0 comments Download
M chrome/browser/banners/app_banner_data_fetcher.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 4 chunks +38 lines, -51 lines 0 comments Download
A chrome/browser/manifest/manifest_icon_downloader.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 1 chunk +69 lines, -0 lines 0 comments Download
A chrome/browser/manifest/manifest_icon_downloader.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 1 chunk +131 lines, -0 lines 0 comments Download
A chrome/browser/manifest/manifest_icon_downloader_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 1 chunk +123 lines, -0 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 79 (17 generated)
Lalit Maganti
Dan: as we discussed yesterday, I've factored out all the icon downloading/choosing code into its ...
5 years, 4 months ago (2015-07-31 13:49:22 UTC) #2
gone
https://codereview.chromium.org/1261143004/diff/30008/chrome/browser/android/banners/app_banner_manager_android.cc File chrome/browser/android/banners/app_banner_manager_android.cc (right): https://codereview.chromium.org/1261143004/diff/30008/chrome/browser/android/banners/app_banner_manager_android.cc#newcode161 chrome/browser/android/banners/app_banner_manager_android.cc:161: return true /*base::FieldTrialList::FindFullName("AppBanners") == "Enabled"*/; On 2015/07/31 13:49:22, Lalit ...
5 years, 4 months ago (2015-07-31 15:56:16 UTC) #3
gone
Can you attach a bug number to this?
5 years, 4 months ago (2015-07-31 17:22:20 UTC) #4
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1261143004/30008 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1261143004/30008
5 years, 4 months ago (2015-07-31 17:24:29 UTC) #6
commit-bot: I haz the power
Dry run: 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/83936)
5 years, 4 months ago (2015-07-31 17:34:17 UTC) #8
gone
https://codereview.chromium.org/1261143004/diff/30008/chrome/browser/banners/app_banner_data_fetcher.cc File chrome/browser/banners/app_banner_data_fetcher.cc (right): https://codereview.chromium.org/1261143004/diff/30008/chrome/browser/banners/app_banner_data_fetcher.cc#newcode299 chrome/browser/banners/app_banner_data_fetcher.cc:299: OnHasServiceWorker(web_contents); Not sure why you pulled this out. The ...
5 years, 4 months ago (2015-07-31 18:09:20 UTC) #9
Lalit Maganti
Thanks for reviewing! Just a point which you've mentioned multiple times which I want to ...
5 years, 4 months ago (2015-08-03 08:58:29 UTC) #10
Lalit Maganti
Thanks for reviewing! Just a point which you've mentioned multiple times which I want to ...
5 years, 4 months ago (2015-08-03 08:58:29 UTC) #11
gone
In cases of refactoring for future CLs, it helps if you link to a follow ...
5 years, 4 months ago (2015-08-03 23:27:58 UTC) #12
Lalit Maganti
Apologies for not linking the followup/mentioning in the commit message. I'll remember that for the ...
5 years, 4 months ago (2015-08-04 08:59:53 UTC) #13
Lalit Maganti
Apologies for not linking the followup/mentioning in the commit message. I'll remember that for the ...
5 years, 4 months ago (2015-08-04 08:59:53 UTC) #14
Lalit Maganti
Hopefully this should solve most of the issues you raised Dan :) https://codereview.chromium.org/1261143004/diff/30008/chrome/browser/banners/app_banner_data_fetcher.cc File chrome/browser/banners/app_banner_data_fetcher.cc ...
5 years, 4 months ago (2015-08-04 17:26:45 UTC) #15
gone
Would probably have given you an l-g-t-m if you had a real commit message by ...
5 years, 4 months ago (2015-08-04 21:41:45 UTC) #16
mlamouri (slow - plz ping)
I have a few comments but mostly nits. The only real blockers is the lack ...
5 years, 4 months ago (2015-08-05 08:20:17 UTC) #18
Lalit Maganti
Have addressed both your comments as well as written tests and made shortcuthelper use the ...
5 years, 4 months ago (2015-08-05 14:47:13 UTC) #19
gone
lgtm @ mlamouri's comments. Good catch on removing the debugging flag enabling, Mounir. One of ...
5 years, 4 months ago (2015-08-05 17:34:46 UTC) #20
gone
Er, that was %, not @. I'm also not sure why you're prefixing the CL ...
5 years, 4 months ago (2015-08-05 17:37:26 UTC) #21
Lalit Maganti
Dan: on why I prefix my commits with the folder: 1. Old habit of mine ...
5 years, 4 months ago (2015-08-06 13:14:48 UTC) #22
gone
On 2015/08/06 13:14:48, Lalit Maganti wrote: > Dan: on why I prefix my commits with ...
5 years, 4 months ago (2015-08-06 16:42:04 UTC) #23
Lalit Maganti
On 2015/08/06 at 16:42:04, dfalcantara wrote: > On 2015/08/06 13:14:48, Lalit Maganti wrote: > > ...
5 years, 4 months ago (2015-08-06 16:43:49 UTC) #24
mlamouri (slow - plz ping)
https://codereview.chromium.org/1261143004/diff/130001/chrome/browser/android/shortcut_data_fetcher.cc File chrome/browser/android/shortcut_data_fetcher.cc (right): https://codereview.chromium.org/1261143004/diff/130001/chrome/browser/android/shortcut_data_fetcher.cc#newcode114 chrome/browser/android/shortcut_data_fetcher.cc:114: bool success = icon_downloader_->Download( nit: no need for the ...
5 years, 4 months ago (2015-08-07 10:11:12 UTC) #25
Lalit Maganti
https://codereview.chromium.org/1261143004/diff/130001/chrome/browser/android/shortcut_data_fetcher.cc File chrome/browser/android/shortcut_data_fetcher.cc (right): https://codereview.chromium.org/1261143004/diff/130001/chrome/browser/android/shortcut_data_fetcher.cc#newcode114 chrome/browser/android/shortcut_data_fetcher.cc:114: bool success = icon_downloader_->Download( On 2015/08/07 at 10:11:11, Mounir ...
5 years, 4 months ago (2015-08-07 13:04:30 UTC) #26
mlamouri (slow - plz ping)
lgtm with comments applied. https://codereview.chromium.org/1261143004/diff/150001/chrome/browser/android/shortcut_data_fetcher.cc File chrome/browser/android/shortcut_data_fetcher.cc (right): https://codereview.chromium.org/1261143004/diff/150001/chrome/browser/android/shortcut_data_fetcher.cc#newcode184 chrome/browser/android/shortcut_data_fetcher.cc:184: if (!web_contents() || !weak_observer_ || ...
5 years, 4 months ago (2015-08-10 15:08:08 UTC) #27
Lalit Maganti
https://codereview.chromium.org/1261143004/diff/150001/chrome/browser/android/shortcut_data_fetcher.cc File chrome/browser/android/shortcut_data_fetcher.cc (right): https://codereview.chromium.org/1261143004/diff/150001/chrome/browser/android/shortcut_data_fetcher.cc#newcode184 chrome/browser/android/shortcut_data_fetcher.cc:184: if (!web_contents() || !weak_observer_ || is_icon_saved_) return; On 2015/08/10 ...
5 years, 4 months ago (2015-08-10 16:55:46 UTC) #28
Lalit Maganti
newt@: could you please take a look at the shortcut_data_fetcher changes?
5 years, 4 months ago (2015-08-10 16:57:24 UTC) #30
newt (away)
rubberstamp lgtm for shortcut_data_fetcher.cc/h based on dfalcantara's review.
5 years, 4 months ago (2015-08-10 18:11:47 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1261143004/190001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1261143004/190001
5 years, 4 months ago (2015-08-11 10:31:00 UTC) #34
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/97593)
5 years, 4 months ago (2015-08-11 11:13:12 UTC) #36
Lalit Maganti
So the test failures are due to the icons being used in tests drawing no ...
5 years, 4 months ago (2015-08-11 13:23:42 UTC) #37
Lalit Maganti
On 2015/08/11 13:23:42, Lalit Maganti wrote: > So the test failures are due to the ...
5 years, 4 months ago (2015-08-11 13:25:35 UTC) #38
Lalit Maganti
Dan and Mounir: To fix the test failures, on Mounir's suggestion, I've removed the density ...
5 years, 4 months ago (2015-08-11 14:05:07 UTC) #39
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1261143004/230001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1261143004/230001
5 years, 4 months ago (2015-08-11 14:05:29 UTC) #41
mlamouri (slow - plz ping)
still lgtm
5 years, 4 months ago (2015-08-11 14:11:22 UTC) #42
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: mac_chromium_compile_dbg_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_compile_dbg_ng/builds/83984)
5 years, 4 months ago (2015-08-11 14:34:22 UTC) #44
gone
I'm fine with removing the density, but it seems that wasn't the cause of your ...
5 years, 4 months ago (2015-08-11 17:46:58 UTC) #45
Lalit Maganti
On 2015/08/11 17:46:58, dfalcantara wrote: > I'm fine with removing the density, but it seems ...
5 years, 4 months ago (2015-08-11 18:24:15 UTC) #46
Lalit Maganti
On 2015/08/11 18:24:15, Lalit Maganti wrote: > On 2015/08/11 17:46:58, dfalcantara wrote: > > I'm ...
5 years, 4 months ago (2015-08-12 13:37:05 UTC) #47
mlamouri (slow - plz ping)
On 2015/08/12 at 13:37:05, lalitm wrote: > On 2015/08/11 18:24:15, Lalit Maganti wrote: > > ...
5 years, 4 months ago (2015-08-12 13:43:44 UTC) #48
gone
On 2015/08/12 13:43:44, Mounir Lamouri wrote: > On 2015/08/12 at 13:37:05, lalitm wrote: > > ...
5 years, 4 months ago (2015-08-12 17:27:18 UTC) #49
gone
Er, I guess discussion is continuing about upscaling is happening on the email thread for ...
5 years, 4 months ago (2015-08-12 17:57:52 UTC) #50
gone
On 2015/08/12 17:57:52, dfalcantara wrote: > Er, I guess discussion is continuing about upscaling is ...
5 years, 4 months ago (2015-08-12 17:58:22 UTC) #51
mlamouri (slow - plz ping)
My understanding of the discussion we had is that we might want to pick a ...
5 years, 4 months ago (2015-08-14 09:40:22 UTC) #52
Lalit Maganti
On 2015/08/14 09:40:22, Mounir Lamouri wrote: > My understanding of the discussion we had is ...
5 years, 4 months ago (2015-08-14 15:35:48 UTC) #53
Lalit Maganti
Mounir and Dan: this should hopefully be the algorithm which we agreed over email implemented.
5 years, 4 months ago (2015-08-18 10:11:03 UTC) #54
mlamouri (slow - plz ping)
https://codereview.chromium.org/1261143004/diff/350001/chrome/browser/manifest/manifest_icon_downloader.cc File chrome/browser/manifest/manifest_icon_downloader.cc (right): https://codereview.chromium.org/1261143004/diff/350001/chrome/browser/manifest/manifest_icon_downloader.cc#newcode29 chrome/browser/manifest/manifest_icon_downloader.cc:29: const float lowest_scale_factor = device_scale_factor - 1; If the ...
5 years, 4 months ago (2015-08-18 14:48:18 UTC) #55
Lalit Maganti
https://codereview.chromium.org/1261143004/diff/350001/chrome/browser/manifest/manifest_icon_downloader.cc File chrome/browser/manifest/manifest_icon_downloader.cc (right): https://codereview.chromium.org/1261143004/diff/350001/chrome/browser/manifest/manifest_icon_downloader.cc#newcode29 chrome/browser/manifest/manifest_icon_downloader.cc:29: const float lowest_scale_factor = device_scale_factor - 1; On 2015/08/18 ...
5 years, 4 months ago (2015-08-18 14:53:50 UTC) #56
Lalit Maganti
I've completely reworked the algorithm in the downloader to be much simpler. As I said ...
5 years, 4 months ago (2015-08-19 12:32:15 UTC) #57
gone
https://chromiumcodereview.appspot.com/1261143004/diff/510001/chrome/browser/banners/app_banner_data_fetcher.h File chrome/browser/banners/app_banner_data_fetcher.h (right): https://chromiumcodereview.appspot.com/1261143004/diff/510001/chrome/browser/banners/app_banner_data_fetcher.h#newcode122 chrome/browser/banners/app_banner_data_fetcher.h:122: // Called when it is determined that the webapp ...
5 years, 4 months ago (2015-08-19 22:21:08 UTC) #58
Lalit Maganti
https://codereview.chromium.org/1261143004/diff/510001/chrome/browser/banners/app_banner_data_fetcher.h File chrome/browser/banners/app_banner_data_fetcher.h (right): https://codereview.chromium.org/1261143004/diff/510001/chrome/browser/banners/app_banner_data_fetcher.h#newcode122 chrome/browser/banners/app_banner_data_fetcher.h:122: // Called when it is determined that the webapp ...
5 years, 4 months ago (2015-08-20 16:48:00 UTC) #59
gone
overall re-lgtm https://codereview.chromium.org/1261143004/diff/550001/chrome/browser/manifest/manifest_icon_downloader.cc File chrome/browser/manifest/manifest_icon_downloader.cc (right): https://codereview.chromium.org/1261143004/diff/550001/chrome/browser/manifest/manifest_icon_downloader.cc#newcode112 chrome/browser/manifest/manifest_icon_downloader.cc:112: // best_index == -1 means the first ...
5 years, 4 months ago (2015-08-20 18:48:42 UTC) #60
mlamouri (slow - plz ping)
https://codereview.chromium.org/1261143004/diff/550001/chrome/browser/android/banners/app_banner_data_fetcher_android.cc File chrome/browser/android/banners/app_banner_data_fetcher_android.cc (right): https://codereview.chromium.org/1261143004/diff/550001/chrome/browser/android/banners/app_banner_data_fetcher_android.cc#newcode39 chrome/browser/android/banners/app_banner_data_fetcher_android.cc:39: return FetchAppIcon(web_contents, image_url); nit: instead do: return FetchAppIcon(GetWebContents(), image_url); ...
5 years, 4 months ago (2015-08-21 09:27:12 UTC) #61
Lalit Maganti
https://codereview.chromium.org/1261143004/diff/550001/chrome/browser/manifest/manifest_icon_downloader.cc File chrome/browser/manifest/manifest_icon_downloader.cc (right): https://codereview.chromium.org/1261143004/diff/550001/chrome/browser/manifest/manifest_icon_downloader.cc#newcode18 chrome/browser/manifest/manifest_icon_downloader.cc:18: if (!web_contents || !icon_url.is_valid()) return false; On 2015/08/21 at ...
5 years, 4 months ago (2015-08-21 12:14:20 UTC) #62
mlamouri (slow - plz ping)
still lgtm with comments applied There were so many iterations that I missed a few ...
5 years, 4 months ago (2015-08-21 12:59:08 UTC) #63
Lalit Maganti
https://codereview.chromium.org/1261143004/diff/610001/chrome/browser/banners/app_banner_data_fetcher.h File chrome/browser/banners/app_banner_data_fetcher.h (right): https://codereview.chromium.org/1261143004/diff/610001/chrome/browser/banners/app_banner_data_fetcher.h#newcode131 chrome/browser/banners/app_banner_data_fetcher.h:131: const scoped_ptr<ManifestIconDownloader>& icon_downloader() { On 2015/08/21 12:59:08, Mounir Lamouri ...
5 years, 4 months ago (2015-08-21 13:21:34 UTC) #64
commit-bot: I haz the power
This CL has an open dependency (Issue 1285063003 Patch 120001). Please resolve the dependency and ...
5 years, 4 months ago (2015-08-21 13:24:33 UTC) #68
mlamouri (slow - plz ping)
https://codereview.chromium.org/1261143004/diff/630001/chrome/browser/android/webapps/add_to_homescreen_data_fetcher.h File chrome/browser/android/webapps/add_to_homescreen_data_fetcher.h (right): https://codereview.chromium.org/1261143004/diff/630001/chrome/browser/android/webapps/add_to_homescreen_data_fetcher.h#newcode26 chrome/browser/android/webapps/add_to_homescreen_data_fetcher.h:26: class ManifestIconDownloader; nit: you no longer need this https://codereview.chromium.org/1261143004/diff/630001/chrome/browser/banners/app_banner_data_fetcher.h ...
5 years, 4 months ago (2015-08-21 13:34:18 UTC) #69
Lalit Maganti
https://codereview.chromium.org/1261143004/diff/630001/chrome/browser/android/webapps/add_to_homescreen_data_fetcher.h File chrome/browser/android/webapps/add_to_homescreen_data_fetcher.h (right): https://codereview.chromium.org/1261143004/diff/630001/chrome/browser/android/webapps/add_to_homescreen_data_fetcher.h#newcode26 chrome/browser/android/webapps/add_to_homescreen_data_fetcher.h:26: class ManifestIconDownloader; On 2015/08/21 13:34:18, Mounir Lamouri wrote: > ...
5 years, 4 months ago (2015-08-21 13:45:51 UTC) #70
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1261143004/670001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1261143004/670001
5 years, 4 months ago (2015-08-21 14:03:54 UTC) #73
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/102328)
5 years, 4 months ago (2015-08-21 15:45:49 UTC) #75
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1261143004/670001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1261143004/670001
5 years, 4 months ago (2015-08-21 15:54:23 UTC) #77
commit-bot: I haz the power
Committed patchset #35 (id:670001)
5 years, 4 months ago (2015-08-21 16:36:04 UTC) #78
commit-bot: I haz the power
5 years, 4 months ago (2015-08-21 16:36:48 UTC) #79
Message was sent while issue was closed.
Patchset 35 (id:??) landed as
https://crrev.com/e109fb09878be947da59c39b5876ae36c187d534
Cr-Commit-Position: refs/heads/master@{#344787}

Powered by Google App Engine
This is Rietveld 408576698