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

Issue 1092873002: [Icons NTP] Refactor large_icon_source to extract the logic shared between desktop and Android to f… (Closed)

Created:
5 years, 8 months ago by beaudoin
Modified:
5 years, 8 months ago
CC:
chromium-reviews, newt (away)
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Icons NTP] Refactor large_icon_source to extract the logic shared between desktop and Android to a new large_icon_service. This is required since the Android implementation of the icon-based NTP will rely on custom Java code to render the fallback. As a result we want to share the logic needed to retrieve large icons and to compute the fallback style without needing them to go through the full-featured chrome://large-icon that performs the rendering of fallback icons. The Java code will hook directly into the large_icon_service. This CL also fixes a bug, making sure only non-square icons can be returned as large icons. Besides this, this CL doesn't change the behavior but will make it possible to add the large icon selection logic to large_icon_service where it can be shared with the Android code. BUG=467712 Committed: https://crrev.com/3e75e59228ae3c4388379ed90ebea2e30ca0c646 Cr-Commit-Position: refs/heads/master@{#326325}

Patch Set 1 #

Patch Set 2 : #

Total comments: 26

Patch Set 3 : #

Patch Set 4 : #

Total comments: 16

Patch Set 5 : #

Patch Set 6 : #

Total comments: 18

Patch Set 7 : #

Total comments: 20

Patch Set 8 : #

Total comments: 3

Patch Set 9 : Added back changes to instant_service.cc #

Total comments: 4

Patch Set 10 : #

Total comments: 16

Patch Set 11 : #

Patch Set 12 : #

Total comments: 10

Patch Set 13 : #

Patch Set 14 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+313 lines, -179 lines) Patch
A + chrome/browser/favicon/large_icon_service_factory.h View 1 2 3 4 5 6 2 chunks +12 lines, -12 lines 0 comments Download
A + chrome/browser/favicon/large_icon_service_factory.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +19 lines, -16 lines 0 comments Download
M chrome/browser/search/instant_service.cc View 1 2 3 4 5 6 7 8 9 3 chunks +6 lines, -8 lines 0 comments Download
M chrome/browser/ui/webui/large_icon_source.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +18 lines, -42 lines 0 comments Download
M chrome/browser/ui/webui/large_icon_source.cc View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +25 lines, -80 lines 0 comments Download
M chrome/browser/ui/webui/ntp/most_visited_handler.cc View 1 2 3 4 5 6 4 chunks +9 lines, -8 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/common/favicon/fallback_icon_url_parser_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +5 lines, -5 lines 0 comments Download
M components/favicon.gypi View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M components/favicon/core/BUILD.gn View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
A components/favicon/core/large_icon_service.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +65 lines, -0 lines 0 comments Download
A components/favicon/core/large_icon_service.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +77 lines, -0 lines 0 comments Download
M components/favicon_base/fallback_icon_style.h View 1 2 3 4 2 chunks +8 lines, -0 lines 0 comments Download
M components/favicon_base/fallback_icon_style.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +28 lines, -6 lines 0 comments Download
M components/favicon_base/favicon_callback.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +6 lines, -0 lines 0 comments Download
M components/favicon_base/favicon_types.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +19 lines, -0 lines 0 comments Download
M components/favicon_base/favicon_types.cc View 1 2 3 4 5 6 2 chunks +10 lines, -2 lines 0 comments Download

Messages

Total messages: 54 (18 generated)
beaudoin
REVIEWERS: - pkotwicz@, huangs@ : Global. - sky@ OWNERS: components/favicon_base/ (Should pkotwicz@ own this?) - ...
5 years, 8 months ago (2015-04-17 02:24:24 UTC) #2
huangs
Thanks for taking this on! Please consider the proposal to centralized some of the logic ...
5 years, 8 months ago (2015-04-17 03:55:18 UTC) #3
pkotwicz
beaudoin@ can you please explain why you are doing this refactor? (I am confused mostly ...
5 years, 8 months ago (2015-04-17 13:56:15 UTC) #4
beaudoin
On 2015/04/17 13:56:15, pkotwicz wrote: > beaudoin@ can you please explain why you are doing ...
5 years, 8 months ago (2015-04-17 14:50:34 UTC) #5
beaudoin
https://codereview.chromium.org/1092873002/diff/20001/chrome/browser/ui/webui/large_icon_source.cc File chrome/browser/ui/webui/large_icon_source.cc (right): https://codereview.chromium.org/1092873002/diff/20001/chrome/browser/ui/webui/large_icon_source.cc#newcode82 chrome/browser/ui/webui/large_icon_source.cc:82: favicon_service_->getLargeIcon( On 2015/04/17 03:55:17, huangs wrote: > NIT: GetLargeIcon() ...
5 years, 8 months ago (2015-04-17 14:50:52 UTC) #6
huangs
Much cleaner! LGTM with nits. https://chromiumcodereview.appspot.com/1092873002/diff/60001/chrome/browser/ui/webui/large_icon_source.cc File chrome/browser/ui/webui/large_icon_source.cc (right): https://chromiumcodereview.appspot.com/1092873002/diff/60001/chrome/browser/ui/webui/large_icon_source.cc#newcode100 chrome/browser/ui/webui/large_icon_source.cc:100: // Bitmap is invalid, ...
5 years, 8 months ago (2015-04-17 15:30:47 UTC) #7
huangs
Much cleaner now! LGTM with nits.
5 years, 8 months ago (2015-04-17 15:30:53 UTC) #8
newt (away)
this looks good from the Android perspective
5 years, 8 months ago (2015-04-17 17:15:43 UTC) #10
huangs
Per discussion with beaudoin@, this also allows Clank to get background, text color, and font ...
5 years, 8 months ago (2015-04-17 17:21:21 UTC) #11
pkotwicz
I think that it would be useful to mention the name (or proposed name) of ...
5 years, 8 months ago (2015-04-17 18:39:14 UTC) #12
pkotwicz
Correction: "I think that it would be useful to mention the name (or proposed name) ...
5 years, 8 months ago (2015-04-17 18:40:03 UTC) #13
beaudoin
Sam: Did most of your nit except one. Peter: - On Android the service's method ...
5 years, 8 months ago (2015-04-17 20:29:05 UTC) #15
huangs
Ping on 1 comment. https://codereview.chromium.org/1092873002/diff/60001/components/favicon/core/favicon_service.cc File components/favicon/core/favicon_service.cc (right): https://codereview.chromium.org/1092873002/diff/60001/components/favicon/core/favicon_service.cc#newcode418 components/favicon/core/favicon_service.cc:418: result.bitmap = bitmap_result; Ping on ...
5 years, 8 months ago (2015-04-17 20:44:04 UTC) #16
beaudoin
PTAL: Extracted to a new large_icon_service, as per Peter's request. REVIEWERS: - pkotwicz@, huangs@ : ...
5 years, 8 months ago (2015-04-20 19:15:06 UTC) #20
huangs
Some quick comments. https://chromiumcodereview.appspot.com/1092873002/diff/160001/chrome/browser/favicon/large_icon_service_factory.cc File chrome/browser/favicon/large_icon_service_factory.cc (right): https://chromiumcodereview.appspot.com/1092873002/diff/160001/chrome/browser/favicon/large_icon_service_factory.cc#newcode39 chrome/browser/favicon/large_icon_service_factory.cc:39: FaviconServiceFactory::GetForProfile(Profile::FromBrowserContext(context), Perhaps in favicon_service_factory.cc, add // ...
5 years, 8 months ago (2015-04-20 19:50:25 UTC) #21
sky
-sky as pkotwicz@chromium.org will be an owner of favicon_base as soon as https://codereview.chromium.org/1096133002/ lands
5 years, 8 months ago (2015-04-20 21:21:24 UTC) #23
beaudoin
Answered Sam's comment. I believe this is ready for final review. Don't hesitate! :) https://codereview.chromium.org/1092873002/diff/160001/chrome/browser/favicon/large_icon_service_factory.cc ...
5 years, 8 months ago (2015-04-21 00:15:39 UTC) #25
huangs
LGTM++ with NITS. Please also run "git cl lint". https://chromiumcodereview.appspot.com/1092873002/diff/180001/chrome/browser/favicon/large_icon_service_factory.cc File chrome/browser/favicon/large_icon_service_factory.cc (right): https://chromiumcodereview.appspot.com/1092873002/diff/180001/chrome/browser/favicon/large_icon_service_factory.cc#newcode1 chrome/browser/favicon/large_icon_service_factory.cc:1: ...
5 years, 8 months ago (2015-04-21 05:00:28 UTC) #26
beaudoin
https://codereview.chromium.org/1092873002/diff/180001/chrome/browser/favicon/large_icon_service_factory.cc File chrome/browser/favicon/large_icon_service_factory.cc (right): https://codereview.chromium.org/1092873002/diff/180001/chrome/browser/favicon/large_icon_service_factory.cc#newcode1 chrome/browser/favicon/large_icon_service_factory.cc:1: // Copyright 2015 The Chromium Authors. All rights reserved. ...
5 years, 8 months ago (2015-04-21 15:11:12 UTC) #28
beaudoin
5 years, 8 months ago (2015-04-21 16:48:39 UTC) #30
kmadhusu
LGTM for chrome/browser/search changes. https://codereview.chromium.org/1092873002/diff/240001/chrome/browser/search/instant_service.cc File chrome/browser/search/instant_service.cc (right): https://codereview.chromium.org/1092873002/diff/240001/chrome/browser/search/instant_service.cc#newcode129 chrome/browser/search/instant_service.cc:129: content::URLDataSource::Add(profile_, style nit: For function ...
5 years, 8 months ago (2015-04-21 17:00:27 UTC) #31
James Hawkins
LGTM with optional comment. https://codereview.chromium.org/1092873002/diff/260001/chrome/browser/ui/webui/large_icon_source.h File chrome/browser/ui/webui/large_icon_source.h (right): https://codereview.chromium.org/1092873002/diff/260001/chrome/browser/ui/webui/large_icon_source.h#newcode68 chrome/browser/ui/webui/large_icon_source.h:68: favicon::FallbackIconService* fallback_icon_service_; I know we ...
5 years, 8 months ago (2015-04-21 17:08:25 UTC) #32
beaudoin
Answered James and Kausalya's comments. https://codereview.chromium.org/1092873002/diff/240001/chrome/browser/search/instant_service.cc File chrome/browser/search/instant_service.cc (right): https://codereview.chromium.org/1092873002/diff/240001/chrome/browser/search/instant_service.cc#newcode129 chrome/browser/search/instant_service.cc:129: content::URLDataSource::Add(profile_, On 2015/04/21 17:00:27, ...
5 years, 8 months ago (2015-04-21 18:09:54 UTC) #33
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1092873002/280001
5 years, 8 months ago (2015-04-21 18:17:21 UTC) #36
pkotwicz
Mostly looks good. Thank you for addding LargeIconService! https://codereview.chromium.org/1092873002/diff/220001/components/favicon_base/favicon_types.h File components/favicon_base/favicon_types.h (right): https://codereview.chromium.org/1092873002/diff/220001/components/favicon_base/favicon_types.h#newcode90 components/favicon_base/favicon_types.h:90: scoped_ptr<FallbackIconStyle> ...
5 years, 8 months ago (2015-04-21 18:19:48 UTC) #37
beaudoin
Answered Peter's comments. https://codereview.chromium.org/1092873002/diff/260001/chrome/browser/favicon/large_icon_service_factory.cc File chrome/browser/favicon/large_icon_service_factory.cc (right): https://codereview.chromium.org/1092873002/diff/260001/chrome/browser/favicon/large_icon_service_factory.cc#newcode38 chrome/browser/favicon/large_icon_service_factory.cc:38: FaviconServiceFactory::GetForBrowserContext(context); On 2015/04/21 18:19:48, pkotwicz wrote: ...
5 years, 8 months ago (2015-04-21 19:03:23 UTC) #38
pkotwicz
https://codereview.chromium.org/1092873002/diff/160001/chrome/browser/favicon/large_icon_service_factory.cc File chrome/browser/favicon/large_icon_service_factory.cc (right): https://codereview.chromium.org/1092873002/diff/160001/chrome/browser/favicon/large_icon_service_factory.cc#newcode39 chrome/browser/favicon/large_icon_service_factory.cc:39: FaviconServiceFactory::GetForProfile(Profile::FromBrowserContext(context), Ping me if you want to discuss some ...
5 years, 8 months ago (2015-04-21 20:13:28 UTC) #39
pkotwicz
5 years, 8 months ago (2015-04-21 20:13:36 UTC) #40
beaudoin
https://codereview.chromium.org/1092873002/diff/160001/chrome/browser/favicon/large_icon_service_factory.cc File chrome/browser/favicon/large_icon_service_factory.cc (right): https://codereview.chromium.org/1092873002/diff/160001/chrome/browser/favicon/large_icon_service_factory.cc#newcode39 chrome/browser/favicon/large_icon_service_factory.cc:39: FaviconServiceFactory::GetForProfile(Profile::FromBrowserContext(context), On 2015/04/21 20:13:28, pkotwicz wrote: > Ping me ...
5 years, 8 months ago (2015-04-21 20:24:05 UTC) #41
pkotwicz
LGTM Please mention why you chose to make LargeIconService return FallbackIconStyle instead of the rendered ...
5 years, 8 months ago (2015-04-21 21:41:05 UTC) #42
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1092873002/340001
5 years, 8 months ago (2015-04-21 22:42:17 UTC) #46
beaudoin
https://codereview.chromium.org/1092873002/diff/300001/components/favicon/core/large_icon_service.cc File components/favicon/core/large_icon_service.cc (right): https://codereview.chromium.org/1092873002/diff/300001/components/favicon/core/large_icon_service.cc#newcode64 components/favicon/core/large_icon_service.cc:64: bitmap_result.bitmap_data, result.fallback_icon_style.get()); On 2015/04/21 21:41:05, pkotwicz wrote: > Nit: ...
5 years, 8 months ago (2015-04-21 23:02:06 UTC) #47
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_ozone_rel_ng/builds/9753)
5 years, 8 months ago (2015-04-21 23:54:26 UTC) #49
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1092873002/360001
5 years, 8 months ago (2015-04-22 16:00:24 UTC) #52
commit-bot: I haz the power
Committed patchset #14 (id:360001)
5 years, 8 months ago (2015-04-22 17:12:33 UTC) #53
commit-bot: I haz the power
5 years, 8 months ago (2015-04-22 17:14:02 UTC) #54
Message was sent while issue was closed.
Patchset 14 (id:??) landed as
https://crrev.com/3e75e59228ae3c4388379ed90ebea2e30ca0c646
Cr-Commit-Position: refs/heads/master@{#326325}

Powered by Google App Engine
This is Rietveld 408576698