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

Issue 2568033005: [NTP::SectionOrder] Replace CategoryFactory with a category ranker. (Closed)

Created:
4 years ago by vitaliii
Modified:
4 years ago
CC:
chromium-reviews, ntp-dev+reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[NTP::SectionOrder] Replace CategoryFactory with a category ranker. This CL: 1) Adds CategoryRanker interface; 2) Adds a default constant category ranker implementation (based on CategoryFactory); 3) Replaces CategoryFactory with a new ranker; 4) Factory methods are moved to Category. This is the initial step of moving to personalised section order. BUG=673659 Committed: https://crrev.com/7456f5ae0859872c69398b583d6331ed47d70586 Cr-Commit-Position: refs/heads/master@{#439451}

Patch Set 1 #

Total comments: 48

Patch Set 2 : rebase & treib@ comments & ios. #

Total comments: 16

Patch Set 3 : download provider tests. #

Total comments: 22

Patch Set 4 : treib@ and tschumann@ comments. #

Total comments: 10

Patch Set 5 : rebase. #

Patch Set 6 : treib@ nits. #

Total comments: 6

Patch Set 7 : rebase. #

Patch Set 8 : tschumann@ comments. #

Patch Set 9 : rebase. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+764 lines, -578 lines) Patch
M chrome/browser/android/ntp/ntp_snippets_bridge.h View 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/browser/android/ntp/ntp_snippets_bridge.cc View 1 2 3 4 15 chunks +20 lines, -23 lines 0 comments Download
M chrome/browser/ntp_snippets/content_suggestions_service_factory.cc View 1 10 chunks +27 lines, -37 lines 0 comments Download
M chrome/browser/ntp_snippets/download_suggestions_provider.h View 2 chunks +0 lines, -2 lines 0 comments Download
M chrome/browser/ntp_snippets/download_suggestions_provider.cc View 1 chunk +2 lines, -3 lines 0 comments Download
M chrome/browser/ntp_snippets/download_suggestions_provider_unittest.cc View 1 2 5 chunks +2 lines, -6 lines 0 comments Download
M chrome/browser/ui/webui/snippets_internals_message_handler.cc View 1 2 3 4 4 chunks +5 lines, -10 lines 0 comments Download
M components/ntp_snippets/BUILD.gn View 1 2 3 4 5 3 chunks +7 lines, -3 lines 0 comments Download
M components/ntp_snippets/bookmarks/bookmark_suggestions_provider.h View 1 chunk +0 lines, -1 line 0 comments Download
M components/ntp_snippets/bookmarks/bookmark_suggestions_provider.cc View 1 2 chunks +3 lines, -4 lines 0 comments Download
M components/ntp_snippets/category.h View 1 2 3 3 chunks +13 lines, -4 lines 0 comments Download
M components/ntp_snippets/category.cc View 1 1 chunk +20 lines, -0 lines 0 comments Download
D components/ntp_snippets/category_factory.h View 1 chunk +0 lines, -61 lines 0 comments Download
D components/ntp_snippets/category_factory.cc View 1 chunk +0 lines, -91 lines 0 comments Download
D components/ntp_snippets/category_factory_unittest.cc View 1 chunk +0 lines, -129 lines 0 comments Download
A components/ntp_snippets/category_rankers/category_ranker.h View 1 2 3 4 5 1 chunk +43 lines, -0 lines 0 comments Download
A components/ntp_snippets/category_rankers/constant_category_ranker.h View 1 2 3 1 chunk +42 lines, -0 lines 0 comments Download
A components/ntp_snippets/category_rankers/constant_category_ranker.cc View 1 2 3 4 5 1 chunk +81 lines, -0 lines 0 comments Download
A components/ntp_snippets/category_rankers/constant_category_ranker_unittest.cc View 1 2 3 1 chunk +124 lines, -0 lines 0 comments Download
A components/ntp_snippets/category_rankers/mock_category_ranker.h View 1 2 3 1 chunk +28 lines, -0 lines 0 comments Download
A components/ntp_snippets/category_rankers/mock_category_ranker.cc View 1 2 3 1 chunk +13 lines, -0 lines 0 comments Download
A components/ntp_snippets/category_unittest.cc View 1 2 3 1 chunk +41 lines, -0 lines 0 comments Download
M components/ntp_snippets/content_suggestions_provider.h View 1 chunk +1 line, -5 lines 0 comments Download
M components/ntp_snippets/content_suggestions_provider.cc View 1 chunk +2 lines, -6 lines 0 comments Download
M components/ntp_snippets/content_suggestions_service.h View 1 6 chunks +8 lines, -7 lines 0 comments Download
M components/ntp_snippets/content_suggestions_service.cc View 1 3 chunks +6 lines, -5 lines 0 comments Download
M components/ntp_snippets/content_suggestions_service_unittest.cc View 1 22 chunks +39 lines, -41 lines 0 comments Download
M components/ntp_snippets/offline_pages/recent_tab_suggestions_provider.h View 1 2 3 4 2 chunks +0 lines, -2 lines 0 comments Download
M components/ntp_snippets/offline_pages/recent_tab_suggestions_provider.cc View 1 chunk +2 lines, -3 lines 0 comments Download
M components/ntp_snippets/offline_pages/recent_tab_suggestions_provider_unittest.cc View 3 chunks +3 lines, -5 lines 0 comments Download
M components/ntp_snippets/physical_web_pages/physical_web_page_suggestions_provider.h View 1 2 chunks +0 lines, -2 lines 0 comments Download
M components/ntp_snippets/physical_web_pages/physical_web_page_suggestions_provider.cc View 1 2 3 4 5 6 1 chunk +3 lines, -4 lines 0 comments Download
M components/ntp_snippets/physical_web_pages/physical_web_page_suggestions_provider_unittest.cc View 1 2 3 4 5 6 3 chunks +2 lines, -6 lines 0 comments Download
M components/ntp_snippets/remote/ntp_snippets_fetcher.h View 1 2 3 4 5 6 2 chunks +1 line, -3 lines 0 comments Download
M components/ntp_snippets/remote/ntp_snippets_fetcher.cc View 1 2 3 4 5 6 5 chunks +3 lines, -6 lines 0 comments Download
M components/ntp_snippets/remote/ntp_snippets_fetcher_unittest.cc View 1 2 3 4 5 6 6 chunks +7 lines, -9 lines 0 comments Download
M components/ntp_snippets/remote/remote_suggestions_provider.h View 1 2 3 4 5 6 4 chunks +5 lines, -2 lines 0 comments Download
M components/ntp_snippets/remote/remote_suggestions_provider.cc View 1 2 3 4 5 6 7 chunks +12 lines, -8 lines 0 comments Download
M components/ntp_snippets/remote/remote_suggestions_provider_unittest.cc View 1 2 3 4 5 6 7 23 chunks +182 lines, -71 lines 0 comments Download
M components/ntp_snippets/sessions/foreign_sessions_suggestions_provider.h View 1 chunk +0 lines, -1 line 0 comments Download
M components/ntp_snippets/sessions/foreign_sessions_suggestions_provider.cc View 2 chunks +3 lines, -4 lines 0 comments Download
M components/ntp_snippets/sessions/foreign_sessions_suggestions_provider_unittest.cc View 4 chunks +2 lines, -5 lines 0 comments Download
M ios/chrome/browser/ntp_snippets/ios_chrome_content_suggestions_service_factory.cc View 1 4 chunks +12 lines, -7 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 69 (48 generated)
vitaliii
[Large CL, many files] Hi Marc, Could you have a look at my CL?
4 years ago (2016-12-13 11:10:02 UTC) #6
Marc Treib
*Much* nicer overall! https://codereview.chromium.org/2568033005/diff/40001/chrome/browser/android/ntp/ntp_snippets_bridge.cc File chrome/browser/android/ntp/ntp_snippets_bridge.cc (right): https://codereview.chromium.org/2568033005/diff/40001/chrome/browser/android/ntp/ntp_snippets_bridge.cc#newcode370 chrome/browser/android/ntp/ntp_snippets_bridge.cc:370: content_suggestions_service_->section_ranker()->OnSuggestionOpened( It'd be nice not to ...
4 years ago (2016-12-13 12:22:42 UTC) #9
vitaliii
Hi Marc, I addressed your comments. PTAL. https://codereview.chromium.org/2568033005/diff/40001/chrome/browser/android/ntp/ntp_snippets_bridge.cc File chrome/browser/android/ntp/ntp_snippets_bridge.cc (right): https://codereview.chromium.org/2568033005/diff/40001/chrome/browser/android/ntp/ntp_snippets_bridge.cc#newcode370 chrome/browser/android/ntp/ntp_snippets_bridge.cc:370: content_suggestions_service_->section_ranker()->OnSuggestionOpened( On ...
4 years ago (2016-12-14 08:59:38 UTC) #18
Marc Treib
https://codereview.chromium.org/2568033005/diff/40001/chrome/browser/android/ntp/ntp_snippets_bridge.cc File chrome/browser/android/ntp/ntp_snippets_bridge.cc (right): https://codereview.chromium.org/2568033005/diff/40001/chrome/browser/android/ntp/ntp_snippets_bridge.cc#newcode370 chrome/browser/android/ntp/ntp_snippets_bridge.cc:370: content_suggestions_service_->section_ranker()->OnSuggestionOpened( On 2016/12/14 08:59:38, vitaliii wrote: > On 2016/12/13 ...
4 years ago (2016-12-14 10:24:31 UTC) #23
Marc Treib
Ah, one comment about the tool: Please try to upload rebases as a separate patch ...
4 years ago (2016-12-14 10:26:54 UTC) #24
tschumann
lgtm really just nits and I don't feel strongly about them https://codereview.chromium.org/2568033005/diff/100001/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc File chrome/browser/ntp_snippets/content_suggestions_service_factory.cc (right): ...
4 years ago (2016-12-15 11:50:26 UTC) #28
Marc Treib
https://codereview.chromium.org/2568033005/diff/100001/components/ntp_snippets/category_rankers/constant_category_ranker.cc File components/ntp_snippets/category_rankers/constant_category_ranker.cc (right): https://codereview.chromium.org/2568033005/diff/100001/components/ntp_snippets/category_rankers/constant_category_ranker.cc#newcode51 components/ntp_snippets/category_rankers/constant_category_ranker.cc:51: //////////////////////////////////////////////////////////////////////////////// On 2016/12/15 11:50:26, tschumann wrote: > i'd drop ...
4 years ago (2016-12-15 12:22:57 UTC) #29
tschumann
https://codereview.chromium.org/2568033005/diff/40001/components/ntp_snippets/remote/remote_suggestions_provider.cc File components/ntp_snippets/remote/remote_suggestions_provider.cc (right): https://codereview.chromium.org/2568033005/diff/40001/components/ntp_snippets/remote/remote_suggestions_provider.cc#newcode605 components/ntp_snippets/remote/remote_suggestions_provider.cc:605: section_ranker_->AppendCategoryIfNecessary(snippet_category); On 2016/12/14 10:24:30, Marc Treib wrote: > On ...
4 years ago (2016-12-15 13:05:20 UTC) #30
vitaliii
I addressed your comments, PTAL. https://codereview.chromium.org/2568033005/diff/40001/chrome/browser/android/ntp/ntp_snippets_bridge.cc File chrome/browser/android/ntp/ntp_snippets_bridge.cc (right): https://codereview.chromium.org/2568033005/diff/40001/chrome/browser/android/ntp/ntp_snippets_bridge.cc#newcode370 chrome/browser/android/ntp/ntp_snippets_bridge.cc:370: content_suggestions_service_->section_ranker()->OnSuggestionOpened( On 2016/12/14 10:24:30, ...
4 years ago (2016-12-15 15:30:13 UTC) #38
Marc Treib
Thanks! LGTM with some last nits. https://codereview.chromium.org/2568033005/diff/140001/components/ntp_snippets/category_rankers/category_ranker.cc File components/ntp_snippets/category_rankers/category_ranker.cc (right): https://codereview.chromium.org/2568033005/diff/140001/components/ntp_snippets/category_rankers/category_ranker.cc#newcode9 components/ntp_snippets/category_rankers/category_ranker.cc:9: CategoryRanker::~CategoryRanker() = default; ...
4 years ago (2016-12-15 16:01:19 UTC) #39
vitaliii
Hi treib@, I addressed your nits, no need to look. https://codereview.chromium.org/2568033005/diff/140001/components/ntp_snippets/category_rankers/category_ranker.cc File components/ntp_snippets/category_rankers/category_ranker.cc (right): https://codereview.chromium.org/2568033005/diff/140001/components/ntp_snippets/category_rankers/category_ranker.cc#newcode9 ...
4 years ago (2016-12-15 16:53:50 UTC) #43
vitaliii
Hi noyau@, could you please have a look at my change of ios service factory?
4 years ago (2016-12-15 16:54:20 UTC) #45
vitaliii
Hi bauerb@, could you please have a look at my change of snippets_internals_message_handler.cc? BTW, shouldn't ...
4 years ago (2016-12-15 16:57:15 UTC) #46
vitaliii
Hi bauerb@, could you please have a look at my change of snippets_internals_message_handler.cc? BTW, shouldn't ...
4 years ago (2016-12-15 16:58:14 UTC) #48
tschumann
lgtm overall design looks good. some final nits, mostly following up on discussions about the ...
4 years ago (2016-12-15 18:23:13 UTC) #51
vitaliii
tschumann@, I addressed your comments, no need to look. bauerb@ and noyau@ please have a ...
4 years ago (2016-12-16 08:15:43 UTC) #54
noyau (Ping after 24h)
ios lgtm
4 years ago (2016-12-16 12:17:46 UTC) #57
Bernhard Bauer
WebUI LGTM. If you want to add OWNERS for the snippets_internals UI, feel free to ...
4 years ago (2016-12-19 10:12:19 UTC) #61
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2568033005/280001
4 years ago (2016-12-19 10:14:02 UTC) #64
commit-bot: I haz the power
Committed patchset #9 (id:280001)
4 years ago (2016-12-19 11:13:57 UTC) #67
commit-bot: I haz the power
4 years ago (2016-12-19 11:15:41 UTC) #69
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/7456f5ae0859872c69398b583d6331ed47d70586
Cr-Commit-Position: refs/heads/master@{#439451}

Powered by Google App Engine
This is Rietveld 408576698