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

Issue 1922083004: Allow fetching personalized snippets from ChromeReader. (Closed)

Created:
4 years, 8 months ago by jkrcal
Modified:
4 years, 7 months ago
CC:
chromium-reviews, sdefresne+watch_chromium.org, mcwilliams+watch_chromium.org, dgn+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Allow fetching personalized snippets from ChromeReader. This amounts to: - adding singin_manager and token_service to the fetcher; - adding a variation parameter to determine the type of fetching (see bug 606320); - changes to the request strings sent to ChromeReader; - getting the snippets ordered by their score (see bug 608713); Additionally, this CL adds a score member to NTPSnippet and exposes it in snippets-internals. (Loading and storing of NTPSnippet needed to be changed a bit as the score entry is stored in the top level suggestion node and not in the contentInfo subnode as everything else that we loaded so far). BUG=603907, 608713, 606320 CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:closure_compilation Committed: https://crrev.com/33a244f68391a327cde16a006150f862ae641aab Cr-Commit-Position: refs/heads/master@{#392886}

Patch Set 1 #

Patch Set 2 : A minor fix #

Patch Set 3 : Feature complete #

Patch Set 4 : Rebase-update and minor polish #

Total comments: 89

Patch Set 5 : Fixing a broken unittest + reflecting code review comments #

Total comments: 6

Patch Set 6 : After code review #2 #

Total comments: 10

Patch Set 7 : Rebase update #

Total comments: 6

Patch Set 8 : After code review #3 #

Patch Set 9 : Minor fixes #

Total comments: 37

Patch Set 10 : After code review #4 #

Total comments: 7

Patch Set 11 : After code review #5 #

Total comments: 8

Patch Set 12 : Fixing GYP build #

Patch Set 13 : After code review #6 + rebase #

Patch Set 14 : Another rebase #

Patch Set 15 : Another rebase #

Patch Set 16 : Adding ICU deps #

Patch Set 17 : A unittest fix #

Patch Set 18 : Another unittest fix #

Patch Set 19 : iOS fix #

Patch Set 20 : Yet another unittest fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+395 lines, -58 lines) Patch
M chrome/browser/ntp_snippets/ntp_snippets_service_factory.cc View 1 2 3 4 5 6 7 5 chunks +12 lines, -1 line 0 comments Download
M chrome/browser/resources/snippets_internals.css View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/resources/snippets_internals.html View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/ui/webui/snippets_internals_message_handler.cc View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M components/ntp_snippets.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +4 lines, -0 lines 0 comments Download
M components/ntp_snippets/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +5 lines, -0 lines 0 comments Download
M components/ntp_snippets/DEPS View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M components/ntp_snippets/ntp_snippet.h View 1 2 3 4 5 6 7 19 2 chunks +4 lines, -0 lines 0 comments Download
M components/ntp_snippets/ntp_snippet.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 4 chunks +9 lines, -1 line 0 comments Download
A components/ntp_snippets/ntp_snippets_constants.h View 1 2 3 1 chunk +15 lines, -0 lines 0 comments Download
A + components/ntp_snippets/ntp_snippets_constants.cc View 1 2 3 1 chunk +4 lines, -4 lines 0 comments Download
M components/ntp_snippets/ntp_snippets_fetcher.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 6 chunks +59 lines, -5 lines 0 comments Download
M components/ntp_snippets/ntp_snippets_fetcher.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 8 chunks +206 lines, -28 lines 0 comments Download
M components/ntp_snippets/ntp_snippets_fetcher_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 15 chunks +41 lines, -15 lines 0 comments Download
M components/ntp_snippets/ntp_snippets_service.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -1 line 0 comments Download
M components/ntp_snippets/ntp_snippets_service_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 4 chunks +17 lines, -2 lines 0 comments Download
M ios/chrome/browser/ntp_snippets/ios_chrome_ntp_snippets_service_factory.cc View 1 2 3 4 5 6 7 4 chunks +11 lines, -1 line 0 comments Download

Messages

Total messages: 50 (18 generated)
jkrcal
bauerb: PTAL at the snippets-internals part. asvitkine: PTAL at the added '+components/variations' dependency treib: PTAL ...
4 years, 7 months ago (2016-05-04 09:37:18 UTC) #5
jkrcal
noyau: PTAL at ios_chrome_ntp_snippets_service_factory
4 years, 7 months ago (2016-05-04 10:01:28 UTC) #7
Bernhard Bauer
https://codereview.chromium.org/1922083004/diff/60001/components/ntp_snippets/ntp_snippets_fetcher.cc File components/ntp_snippets/ntp_snippets_fetcher.cc (right): https://codereview.chromium.org/1922083004/diff/60001/components/ntp_snippets/ntp_snippets_fetcher.cc#newcode120 components/ntp_snippets/ntp_snippets_fetcher.cc:120: is_stable_channel_(is_stable_channel){ Space before opening brace (also in other places ...
4 years, 7 months ago (2016-05-04 11:46:59 UTC) #8
Marc Treib
(probably some duplication here with Bernhard's comments...) https://codereview.chromium.org/1922083004/diff/60001/components/ntp_snippets/ntp_snippet.h File components/ntp_snippets/ntp_snippet.h (right): https://codereview.chromium.org/1922083004/diff/60001/components/ntp_snippets/ntp_snippet.h#newcode102 components/ntp_snippets/ntp_snippet.h:102: double score_; ...
4 years, 7 months ago (2016-05-04 11:50:10 UTC) #9
jkrcal
Thanks for all the comments! PTAL again. https://codereview.chromium.org/1922083004/diff/60001/components/ntp_snippets/ntp_snippet.h File components/ntp_snippets/ntp_snippet.h (right): https://codereview.chromium.org/1922083004/diff/60001/components/ntp_snippets/ntp_snippet.h#newcode102 components/ntp_snippets/ntp_snippet.h:102: double score_; ...
4 years, 7 months ago (2016-05-04 14:04:09 UTC) #10
Bernhard Bauer
https://codereview.chromium.org/1922083004/diff/80001/components/ntp_snippets/ntp_snippets_fetcher.cc File components/ntp_snippets/ntp_snippets_fetcher.cc (right): https://codereview.chromium.org/1922083004/diff/80001/components/ntp_snippets/ntp_snippets_fetcher.cc#newcode209 components/ntp_snippets/ntp_snippets_fetcher.cc:209: GURL url = GURL(base::StringPrintf(kSnippetsServerNonAuthorizedFormat, Just directly initialize |url|. https://codereview.chromium.org/1922083004/diff/80001/components/ntp_snippets/ntp_snippets_fetcher.cc#newcode258 ...
4 years, 7 months ago (2016-05-04 14:11:55 UTC) #11
noyau (Ping after 24h)
ios/ lgtm
4 years, 7 months ago (2016-05-04 14:19:18 UTC) #12
jkrcal
Addressed the comments. PTAL. https://codereview.chromium.org/1922083004/diff/80001/components/ntp_snippets/ntp_snippets_fetcher.cc File components/ntp_snippets/ntp_snippets_fetcher.cc (right): https://codereview.chromium.org/1922083004/diff/80001/components/ntp_snippets/ntp_snippets_fetcher.cc#newcode209 components/ntp_snippets/ntp_snippets_fetcher.cc:209: GURL url = GURL(base::StringPrintf(kSnippetsServerNonAuthorizedFormat, On ...
4 years, 7 months ago (2016-05-04 14:58:19 UTC) #13
Marc Treib
https://codereview.chromium.org/1922083004/diff/60001/components/ntp_snippets/ntp_snippets_fetcher.cc File components/ntp_snippets/ntp_snippets_fetcher.cc (right): https://codereview.chromium.org/1922083004/diff/60001/components/ntp_snippets/ntp_snippets_fetcher.cc#newcode167 components/ntp_snippets/ntp_snippets_fetcher.cc:167: } On 2016/05/04 14:04:07, jkrcal wrote: > On 2016/05/04 ...
4 years, 7 months ago (2016-05-04 15:24:25 UTC) #14
Bernhard Bauer
https://codereview.chromium.org/1922083004/diff/120001/components/ntp_snippets/ntp_snippets_fetcher.cc File components/ntp_snippets/ntp_snippets_fetcher.cc (right): https://codereview.chromium.org/1922083004/diff/120001/components/ntp_snippets/ntp_snippets_fetcher.cc#newcode307 components/ntp_snippets/ntp_snippets_fetcher.cc:307: << error_response; This seems like it should fit on ...
4 years, 7 months ago (2016-05-04 15:56:36 UTC) #15
jkrcal
PTAL. https://codereview.chromium.org/1922083004/diff/60001/components/ntp_snippets/ntp_snippets_fetcher.cc File components/ntp_snippets/ntp_snippets_fetcher.cc (right): https://codereview.chromium.org/1922083004/diff/60001/components/ntp_snippets/ntp_snippets_fetcher.cc#newcode167 components/ntp_snippets/ntp_snippets_fetcher.cc:167: } On 2016/05/04 15:24:24, Marc Treib wrote: > ...
4 years, 7 months ago (2016-05-09 11:58:06 UTC) #16
Marc Treib
https://codereview.chromium.org/1922083004/diff/160001/components/ntp_snippets/ntp_snippets_fetcher.cc File components/ntp_snippets/ntp_snippets_fetcher.cc (right): https://codereview.chromium.org/1922083004/diff/160001/components/ntp_snippets/ntp_snippets_fetcher.cc#newcode24 components/ntp_snippets/ntp_snippets_fetcher.cc:24: #include "components/signin/core/browser/signin_tracker.h" Is this needed? https://codereview.chromium.org/1922083004/diff/160001/components/ntp_snippets/ntp_snippets_fetcher.cc#newcode51 components/ntp_snippets/ntp_snippets_fetcher.cc:51: const char ...
4 years, 7 months ago (2016-05-09 12:33:34 UTC) #17
jkrcal
PTAL https://codereview.chromium.org/1922083004/diff/160001/components/ntp_snippets/ntp_snippets_fetcher.cc File components/ntp_snippets/ntp_snippets_fetcher.cc (right): https://codereview.chromium.org/1922083004/diff/160001/components/ntp_snippets/ntp_snippets_fetcher.cc#newcode24 components/ntp_snippets/ntp_snippets_fetcher.cc:24: #include "components/signin/core/browser/signin_tracker.h" On 2016/05/09 12:33:33, Marc Treib wrote: ...
4 years, 7 months ago (2016-05-09 15:30:13 UTC) #18
Marc Treib
https://codereview.chromium.org/1922083004/diff/160001/components/ntp_snippets/ntp_snippets_fetcher.cc File components/ntp_snippets/ntp_snippets_fetcher.cc (right): https://codereview.chromium.org/1922083004/diff/160001/components/ntp_snippets/ntp_snippets_fetcher.cc#newcode297 components/ntp_snippets/ntp_snippets_fetcher.cc:297: const std::string& account_id) { On 2016/05/09 15:30:13, jkrcal wrote: ...
4 years, 7 months ago (2016-05-09 16:48:25 UTC) #19
Bernhard Bauer
https://codereview.chromium.org/1922083004/diff/160001/components/ntp_snippets/ntp_snippets_fetcher.cc File components/ntp_snippets/ntp_snippets_fetcher.cc (right): https://codereview.chromium.org/1922083004/diff/160001/components/ntp_snippets/ntp_snippets_fetcher.cc#newcode130 components/ntp_snippets/ntp_snippets_fetcher.cc:130: DLOG(WARNING) << "Unknown fetching variant provided: " << variant; ...
4 years, 7 months ago (2016-05-09 17:45:07 UTC) #20
jkrcal
Thanks for the quick reactions! PTAL, again. https://codereview.chromium.org/1922083004/diff/160001/components/ntp_snippets/ntp_snippets_fetcher.cc File components/ntp_snippets/ntp_snippets_fetcher.cc (right): https://codereview.chromium.org/1922083004/diff/160001/components/ntp_snippets/ntp_snippets_fetcher.cc#newcode130 components/ntp_snippets/ntp_snippets_fetcher.cc:130: DLOG(WARNING) << ...
4 years, 7 months ago (2016-05-09 19:04:16 UTC) #21
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1922083004/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1922083004/200001
4 years, 7 months ago (2016-05-09 19:05:07 UTC) #23
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/200468) mac_chromium_rel_ng on ...
4 years, 7 months ago (2016-05-09 19:15:15 UTC) #25
Marc Treib
LGTM with some more (optional) nits, plus a (non-optional) build fix ;) https://codereview.chromium.org/1922083004/diff/180001/components/ntp_snippets/ntp_snippets_fetcher.cc File components/ntp_snippets/ntp_snippets_fetcher.cc ...
4 years, 7 months ago (2016-05-10 08:42:20 UTC) #26
Bernhard Bauer
lgtm
4 years, 7 months ago (2016-05-10 08:56:58 UTC) #27
jkrcal
Thanks for all the help, guys! https://codereview.chromium.org/1922083004/diff/200001/components/ntp_snippets.gypi File components/ntp_snippets.gypi (right): https://codereview.chromium.org/1922083004/diff/200001/components/ntp_snippets.gypi#newcode32 components/ntp_snippets.gypi:32: 'ntp_snippets_constants.h', On 2016/05/10 ...
4 years, 7 months ago (2016-05-10 09:10:07 UTC) #28
Marc Treib
LGTM, thanks! (Looks like you need another rebase now...)
4 years, 7 months ago (2016-05-10 09:13:46 UTC) #29
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1922083004/320001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1922083004/320001
4 years, 7 months ago (2016-05-10 16:02:16 UTC) #31
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/226316)
4 years, 7 months ago (2016-05-10 17:11:13 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/1922083004/340001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1922083004/340001
4 years, 7 months ago (2016-05-10 17:32:27 UTC) #35
Alexei Svitkine (slow)
lgtm on use of variations api
4 years, 7 months ago (2016-05-10 17:52:46 UTC) #36
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: ios-simulator on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/builds/3147)
4 years, 7 months ago (2016-05-10 18:09:42 UTC) #38
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1922083004/380001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1922083004/380001
4 years, 7 months ago (2016-05-11 08:23:07 UTC) #40
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 7 months ago (2016-05-11 09:23:22 UTC) #42
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1922083004/380001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1922083004/380001
4 years, 7 months ago (2016-05-11 09:25:15 UTC) #46
commit-bot: I haz the power
Committed patchset #20 (id:380001)
4 years, 7 months ago (2016-05-11 09:28:53 UTC) #48
commit-bot: I haz the power
4 years, 7 months ago (2016-05-11 09:30:58 UTC) #50
Message was sent while issue was closed.
Patchset 20 (id:??) landed as
https://crrev.com/33a244f68391a327cde16a006150f862ae641aab
Cr-Commit-Position: refs/heads/master@{#392886}

Powered by Google App Engine
This is Rietveld 408576698