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

Issue 2194203002: Make ContentSuggestionsService recognize new/removed categories (Closed)

Created:
4 years, 4 months ago by Philipp Keck
Modified:
4 years, 4 months ago
Reviewers:
Marc Treib, tschumann
CC:
chromium-reviews, ntp-dev+reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@renaming
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make ContentSuggestionsService recognize new/removed categories Change the OnNewSuggestions and OnCategoryStatusChanged methods in ContentSuggestionsService so that they recognize new categories being added and OnCategoryStatusChanged recognizes categories being removed when their status changes to NOT_PROVIDED. This allows providers to change their provided categories dynamically. Little fix: Make Category(int) constructor explicit BUG=632320 Committed: https://crrev.com/4d3a4d66ed9290eec918786cd7457ef1bf46e0dc Cr-Commit-Position: refs/heads/master@{#409160}

Patch Set 1 #

Patch Set 2 : Adjust ContentSuggestionsServiceTest #

Patch Set 3 : Put the status-change notification back in RegisterProvider() #

Total comments: 35

Patch Set 4 : Tim's and Marc's comments #

Patch Set 5 : Rename providers_by_category_ in unit test #

Patch Set 6 : Adjust OnCategoryStatusChanged comment #

Patch Set 7 : Rename EnsureCategoryRegistered to RegisterCategoryIfRequired #

Total comments: 8

Patch Set 8 : Marc's comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+99 lines, -56 lines) Patch
M components/ntp_snippets/category.h View 1 chunk +1 line, -1 line 0 comments Download
M components/ntp_snippets/content_suggestions_provider.h View 1 2 3 4 5 2 chunks +21 lines, -10 lines 0 comments Download
M components/ntp_snippets/content_suggestions_service.h View 1 2 3 4 5 6 7 2 chunks +10 lines, -5 lines 0 comments Download
M components/ntp_snippets/content_suggestions_service.cc View 1 2 3 4 5 6 7 6 chunks +59 lines, -33 lines 0 comments Download
M components/ntp_snippets/content_suggestions_service_unittest.cc View 1 2 3 4 2 chunks +3 lines, -3 lines 0 comments Download
M components/ntp_snippets/ntp_snippets_service.cc View 1 2 3 4 5 6 7 2 chunks +3 lines, -2 lines 0 comments Download
M components/ntp_snippets/offline_pages/offline_page_suggestions_provider.cc View 1 2 3 4 5 6 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 25 (7 generated)
Philipp Keck
PTAL
4 years, 4 months ago (2016-08-01 13:59:20 UTC) #2
tschumann
https://codereview.chromium.org/2194203002/diff/40001/components/ntp_snippets/content_suggestions_provider.h File components/ntp_snippets/content_suggestions_provider.h (right): https://codereview.chromium.org/2194203002/diff/40001/components/ntp_snippets/content_suggestions_provider.h#newcode80 components/ntp_snippets/content_suggestions_provider.h:80: // removing categories) is called on the observer. i ...
4 years, 4 months ago (2016-08-01 14:21:17 UTC) #4
Marc Treib
https://codereview.chromium.org/2194203002/diff/40001/components/ntp_snippets/content_suggestions_provider.h File components/ntp_snippets/content_suggestions_provider.h (right): https://codereview.chromium.org/2194203002/diff/40001/components/ntp_snippets/content_suggestions_provider.h#newcode44 components/ntp_snippets/content_suggestions_provider.h:44: // category. I find this a bit confusing... it's ...
4 years, 4 months ago (2016-08-01 14:23:38 UTC) #5
Philipp Keck
https://codereview.chromium.org/2194203002/diff/40001/components/ntp_snippets/content_suggestions_provider.h File components/ntp_snippets/content_suggestions_provider.h (right): https://codereview.chromium.org/2194203002/diff/40001/components/ntp_snippets/content_suggestions_provider.h#newcode44 components/ntp_snippets/content_suggestions_provider.h:44: // category. On 2016/08/01 14:23:37, Marc Treib wrote: > ...
4 years, 4 months ago (2016-08-01 14:59:04 UTC) #6
Marc Treib
https://codereview.chromium.org/2194203002/diff/40001/components/ntp_snippets/content_suggestions_provider.h File components/ntp_snippets/content_suggestions_provider.h (right): https://codereview.chromium.org/2194203002/diff/40001/components/ntp_snippets/content_suggestions_provider.h#newcode55 components/ntp_snippets/content_suggestions_provider.h:55: // NOT_PROVIDED). On 2016/08/01 14:59:03, Philipp Keck wrote: > ...
4 years, 4 months ago (2016-08-01 15:17:48 UTC) #7
Marc Treib
Ah, and please add a bug number to the description, probably 632320.
4 years, 4 months ago (2016-08-01 15:22:47 UTC) #8
Philipp Keck
https://codereview.chromium.org/2194203002/diff/40001/components/ntp_snippets/content_suggestions_provider.h File components/ntp_snippets/content_suggestions_provider.h (right): https://codereview.chromium.org/2194203002/diff/40001/components/ntp_snippets/content_suggestions_provider.h#newcode55 components/ntp_snippets/content_suggestions_provider.h:55: // NOT_PROVIDED). On 2016/08/01 15:17:47, Marc Treib wrote: > ...
4 years, 4 months ago (2016-08-01 15:58:12 UTC) #10
tschumann
lgtm https://codereview.chromium.org/2194203002/diff/40001/components/ntp_snippets/content_suggestions_provider.h File components/ntp_snippets/content_suggestions_provider.h (right): https://codereview.chromium.org/2194203002/diff/40001/components/ntp_snippets/content_suggestions_provider.h#newcode80 components/ntp_snippets/content_suggestions_provider.h:80: // removing categories) is called on the observer. ...
4 years, 4 months ago (2016-08-01 16:24:09 UTC) #11
Marc Treib
https://codereview.chromium.org/2194203002/diff/40001/components/ntp_snippets/content_suggestions_service.cc File components/ntp_snippets/content_suggestions_service.cc (right): https://codereview.chromium.org/2194203002/diff/40001/components/ntp_snippets/content_suggestions_service.cc#newcode152 components/ntp_snippets/content_suggestions_service.cc:152: NotifyCategoryStatusChanged(category); On 2016/08/01 15:58:12, Philipp Keck wrote: > On ...
4 years, 4 months ago (2016-08-01 16:28:52 UTC) #12
tschumann
https://codereview.chromium.org/2194203002/diff/40001/components/ntp_snippets/content_suggestions_provider.h File components/ntp_snippets/content_suggestions_provider.h (right): https://codereview.chromium.org/2194203002/diff/40001/components/ntp_snippets/content_suggestions_provider.h#newcode55 components/ntp_snippets/content_suggestions_provider.h:55: // NOT_PROVIDED). On 2016/08/01 15:58:11, Philipp Keck wrote: > ...
4 years, 4 months ago (2016-08-01 16:30:12 UTC) #13
Philipp Keck
Renamed the method. So shall I still land this CL and do the refactoring later? ...
4 years, 4 months ago (2016-08-01 17:04:58 UTC) #14
tschumann
lgtm lgtm On 2016/08/01 17:04:58, Philipp Keck wrote: > Renamed the method. > > So ...
4 years, 4 months ago (2016-08-01 17:30:26 UTC) #15
Marc Treib
LGTM with a few more nits - I'm also fine with landing this as-is and ...
4 years, 4 months ago (2016-08-01 17:30:36 UTC) #16
Philipp Keck
https://codereview.chromium.org/2194203002/diff/120001/components/ntp_snippets/content_suggestions_provider.h File components/ntp_snippets/content_suggestions_provider.h (right): https://codereview.chromium.org/2194203002/diff/120001/components/ntp_snippets/content_suggestions_provider.h#newcode43 components/ntp_snippets/content_suggestions_provider.h:43: // known yet, the calling |provider| will be registered ...
4 years, 4 months ago (2016-08-02 08:15:46 UTC) #17
Philipp Keck
https://codereview.chromium.org/2194203002/diff/120001/components/ntp_snippets/content_suggestions_service.cc File components/ntp_snippets/content_suggestions_service.cc (right): https://codereview.chromium.org/2194203002/diff/120001/components/ntp_snippets/content_suggestions_service.cc#newcode214 components/ntp_snippets/content_suggestions_service.cc:214: auto entry = providers_by_category_.find(category); On 2016/08/01 17:30:35, Marc Treib ...
4 years, 4 months ago (2016-08-02 08:34:38 UTC) #18
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/2194203002/140001
4 years, 4 months ago (2016-08-02 08:34:54 UTC) #21
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 4 months ago (2016-08-02 09:06:42 UTC) #23
commit-bot: I haz the power
4 years, 4 months ago (2016-08-02 09:08:15 UTC) #25
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/4d3a4d66ed9290eec918786cd7457ef1bf46e0dc
Cr-Commit-Position: refs/heads/master@{#409160}

Powered by Google App Engine
This is Rietveld 408576698