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

Issue 2406573002: 📰 Persist category dismissals (Closed)

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

Description

[NTP Client] Persist category dismissals - Persists the ids of dismissed categories to preferences as a list of category ids - Restores the dismissed categories from the list of dismissed ids when the ContentSuggestionService is created, and matches with providers when they are registered. - Changes the way dismissals are cleared, from happening when anything about the category changes to only happen when a non empty list of suggestions is received. BUG=638580 Committed: https://crrev.com/5291472f4339aca714470a1359ffb4e444de7960 Cr-Commit-Position: refs/heads/master@{#425939}

Patch Set 1 #

Patch Set 2 : ready for review #

Total comments: 5

Patch Set 3 : fix tests #

Patch Set 4 : fix test #

Total comments: 7

Patch Set 5 : rebase and rewrite #

Total comments: 34

Patch Set 6 : address comments #

Total comments: 11

Patch Set 7 : rebase, address comments, add test #

Total comments: 2

Patch Set 8 : address comment #

Patch Set 9 : #

Total comments: 2

Patch Set 10 : fix nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+259 lines, -31 lines) Patch
M chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/prefs/browser_prefs.cc View 1 2 3 4 5 6 2 chunks +2 lines, -0 lines 0 comments Download
M components/ntp_snippets/category.h View 1 2 3 4 5 6 7 1 chunk +3 lines, -0 lines 0 comments Download
M components/ntp_snippets/category_factory.cc View 1 2 3 4 5 1 chunk +4 lines, -0 lines 0 comments Download
M components/ntp_snippets/category_factory_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -1 line 0 comments Download
M components/ntp_snippets/content_suggestions_service.h View 1 2 3 4 5 6 7 chunks +24 lines, -4 lines 0 comments Download
M components/ntp_snippets/content_suggestions_service.cc View 1 2 3 4 5 6 11 chunks +121 lines, -21 lines 0 comments Download
M components/ntp_snippets/content_suggestions_service_unittest.cc View 1 2 3 4 5 6 7 8 9 6 chunks +98 lines, -4 lines 0 comments Download
M components/ntp_snippets/pref_names.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M components/ntp_snippets/pref_names.cc View 1 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 62 (39 generated)
dgn
PTAL. Tests are not completely working yet.
4 years, 2 months ago (2016-10-10 16:30:09 UTC) #4
tschumann
A quick drive-by comment... https://codereview.chromium.org/2406573002/diff/20001/components/ntp_snippets/content_suggestions_provider.h File components/ntp_snippets/content_suggestions_provider.h (right): https://codereview.chromium.org/2406573002/diff/20001/components/ntp_snippets/content_suggestions_provider.h#newcode64 components/ntp_snippets/content_suggestions_provider.h:64: virtual void OnNewSuggestionBatch(ContentSuggestionsProvider* provider, Do ...
4 years, 2 months ago (2016-10-10 16:50:55 UTC) #6
dgn
https://codereview.chromium.org/2406573002/diff/20001/components/ntp_snippets/content_suggestions_provider.h File components/ntp_snippets/content_suggestions_provider.h (right): https://codereview.chromium.org/2406573002/diff/20001/components/ntp_snippets/content_suggestions_provider.h#newcode64 components/ntp_snippets/content_suggestions_provider.h:64: virtual void OnNewSuggestionBatch(ContentSuggestionsProvider* provider, On 2016/10/10 16:50:54, tschumann wrote: ...
4 years, 2 months ago (2016-10-10 18:27:59 UTC) #7
dgn
https://codereview.chromium.org/2406573002/diff/20001/components/ntp_snippets/content_suggestions_provider.h File components/ntp_snippets/content_suggestions_provider.h (right): https://codereview.chromium.org/2406573002/diff/20001/components/ntp_snippets/content_suggestions_provider.h#newcode64 components/ntp_snippets/content_suggestions_provider.h:64: virtual void OnNewSuggestionBatch(ContentSuggestionsProvider* provider, On 2016/10/10 18:27:59, dgn wrote: ...
4 years, 2 months ago (2016-10-10 19:54:53 UTC) #14
tschumann
https://codereview.chromium.org/2406573002/diff/20001/components/ntp_snippets/content_suggestions_provider.h File components/ntp_snippets/content_suggestions_provider.h (right): https://codereview.chromium.org/2406573002/diff/20001/components/ntp_snippets/content_suggestions_provider.h#newcode64 components/ntp_snippets/content_suggestions_provider.h:64: virtual void OnNewSuggestionBatch(ContentSuggestionsProvider* provider, On 2016/10/10 19:54:53, dgn wrote: ...
4 years, 2 months ago (2016-10-10 20:40:23 UTC) #18
dgn
https://codereview.chromium.org/2406573002/diff/20001/components/ntp_snippets/content_suggestions_provider.h File components/ntp_snippets/content_suggestions_provider.h (right): https://codereview.chromium.org/2406573002/diff/20001/components/ntp_snippets/content_suggestions_provider.h#newcode64 components/ntp_snippets/content_suggestions_provider.h:64: virtual void OnNewSuggestionBatch(ContentSuggestionsProvider* provider, On 2016/10/10 20:40:23, tschumann wrote: ...
4 years, 2 months ago (2016-10-10 21:10:18 UTC) #19
Marc Treib
I'm looking now; sorry for the delay. Note that this will require a (probably non-trivial) ...
4 years, 2 months ago (2016-10-11 07:39:24 UTC) #20
Marc Treib
I haven't looked at everything in detail yet, but added a comment on the SuggestionBatch ...
4 years, 2 months ago (2016-10-11 07:52:55 UTC) #21
dgn
https://codereview.chromium.org/2406573002/diff/60001/components/ntp_snippets/content_suggestions_provider.h File components/ntp_snippets/content_suggestions_provider.h (right): https://codereview.chromium.org/2406573002/diff/60001/components/ntp_snippets/content_suggestions_provider.h#newcode65 components/ntp_snippets/content_suggestions_provider.h:65: SuggestionBatch suggestion_batch) = 0; On 2016/10/11 07:52:55, Marc Treib ...
4 years, 2 months ago (2016-10-11 19:14:01 UTC) #22
dgn
PTAL https://codereview.chromium.org/2406573002/diff/80001/components/ntp_snippets/category_factory.cc File components/ntp_snippets/category_factory.cc (right): https://codereview.chromium.org/2406573002/diff/80001/components/ntp_snippets/category_factory.cc#newcode26 components/ntp_snippets/category_factory.cc:26: AddKnownCategory(KnownCategories::ARTICLES); Added to keep the articles as the ...
4 years, 2 months ago (2016-10-13 14:46:51 UTC) #29
dgn
PTAL https://codereview.chromium.org/2406573002/diff/80001/components/ntp_snippets/category_factory.cc File components/ntp_snippets/category_factory.cc (right): https://codereview.chromium.org/2406573002/diff/80001/components/ntp_snippets/category_factory.cc#newcode26 components/ntp_snippets/category_factory.cc:26: AddKnownCategory(KnownCategories::ARTICLES); Added to keep the articles as the ...
4 years, 2 months ago (2016-10-13 14:46:52 UTC) #30
Marc Treib
Thanks! Mostly LG now. https://codereview.chromium.org/2406573002/diff/80001/components/ntp_snippets/category_factory.cc File components/ntp_snippets/category_factory.cc (right): https://codereview.chromium.org/2406573002/diff/80001/components/ntp_snippets/category_factory.cc#newcode26 components/ntp_snippets/category_factory.cc:26: AddKnownCategory(KnownCategories::ARTICLES); On 2016/10/13 14:46:51, dgn ...
4 years, 2 months ago (2016-10-13 15:59:01 UTC) #33
Bernhard Bauer
Java LGTM, C++ LGTM when Marc is happy :)
4 years, 2 months ago (2016-10-13 16:15:48 UTC) #34
dgn
PTAL. New tests still TBD https://codereview.chromium.org/2406573002/diff/80001/components/ntp_snippets/content_suggestions_service.cc File components/ntp_snippets/content_suggestions_service.cc (right): https://codereview.chromium.org/2406573002/diff/80001/components/ntp_snippets/content_suggestions_service.cc#newcode165 components/ntp_snippets/content_suggestions_service.cc:165: suggestions_by_category_.erase(category); On 2016/10/13 15:59:00, ...
4 years, 2 months ago (2016-10-14 21:20:29 UTC) #36
Marc Treib
Thanks! LGTM with a few more nits https://codereview.chromium.org/2406573002/diff/100001/components/ntp_snippets/content_suggestions_service.cc File components/ntp_snippets/content_suggestions_service.cc (right): https://codereview.chromium.org/2406573002/diff/100001/components/ntp_snippets/content_suggestions_service.cc#newcode182 components/ntp_snippets/content_suggestions_service.cc:182: dismissed_providers_by_category_.erase(category_provider_pair.first); I ...
4 years, 2 months ago (2016-10-17 08:44:46 UTC) #40
dgn
PTAL. Ready for submitting now. https://codereview.chromium.org/2406573002/diff/100001/components/ntp_snippets/content_suggestions_service.cc File components/ntp_snippets/content_suggestions_service.cc (right): https://codereview.chromium.org/2406573002/diff/100001/components/ntp_snippets/content_suggestions_service.cc#newcode182 components/ntp_snippets/content_suggestions_service.cc:182: dismissed_providers_by_category_.erase(category_provider_pair.first); On 2016/10/17 08:44:46, ...
4 years, 2 months ago (2016-10-17 16:41:51 UTC) #43
Bernhard Bauer
lgtm https://codereview.chromium.org/2406573002/diff/120001/components/ntp_snippets/category_factory_unittest.cc File components/ntp_snippets/category_factory_unittest.cc (right): https://codereview.chromium.org/2406573002/diff/120001/components/ntp_snippets/category_factory_unittest.cc#newcode19 components/ntp_snippets/category_factory_unittest.cc:19: CategoryFactoryTest() : unused_remote_category_id_(2) {} Nit: You could just ...
4 years, 2 months ago (2016-10-17 16:52:04 UTC) #44
dgn
https://codereview.chromium.org/2406573002/diff/120001/components/ntp_snippets/category_factory_unittest.cc File components/ntp_snippets/category_factory_unittest.cc (right): https://codereview.chromium.org/2406573002/diff/120001/components/ntp_snippets/category_factory_unittest.cc#newcode19 components/ntp_snippets/category_factory_unittest.cc:19: CategoryFactoryTest() : unused_remote_category_id_(2) {} On 2016/10/17 16:52:04, Bernhard Bauer ...
4 years, 2 months ago (2016-10-17 17:12:30 UTC) #47
Marc Treib
In case you were waiting for me: Still LGTM! :) https://codereview.chromium.org/2406573002/diff/100001/components/ntp_snippets/content_suggestions_service_unittest.cc File components/ntp_snippets/content_suggestions_service_unittest.cc (right): https://codereview.chromium.org/2406573002/diff/100001/components/ntp_snippets/content_suggestions_service_unittest.cc#newcode203 ...
4 years, 2 months ago (2016-10-18 07:44:31 UTC) #54
dgn
https://codereview.chromium.org/2406573002/diff/100001/components/ntp_snippets/content_suggestions_service_unittest.cc File components/ntp_snippets/content_suggestions_service_unittest.cc (right): https://codereview.chromium.org/2406573002/diff/100001/components/ntp_snippets/content_suggestions_service_unittest.cc#newcode203 components/ntp_snippets/content_suggestions_service_unittest.cc:203: UserClassifier::RegisterProfilePrefs(pref_service_->registry()); On 2016/10/18 07:44:31, Marc Treib wrote: > On ...
4 years, 2 months ago (2016-10-18 09:27:18 UTC) #55
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/2406573002/180001
4 years, 2 months ago (2016-10-18 09:27:36 UTC) #58
commit-bot: I haz the power
Committed patchset #10 (id:180001)
4 years, 2 months ago (2016-10-18 10:29:08 UTC) #60
commit-bot: I haz the power
4 years, 2 months ago (2016-10-18 10:31:30 UTC) #62
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/5291472f4339aca714470a1359ffb4e444de7960
Cr-Commit-Position: refs/heads/master@{#425939}

Powered by Google App Engine
This is Rietveld 408576698