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

Issue 2131943002: Change NTPSnippetsService to implement ContentSuggestionsProvider (Closed)

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

Description

Change NTPSnippetsService to implement ContentSuggestionsProvider The NTPSnippetsService currently delivers snippets to the UI via the Android bridge. Change it to additionally serve as a ContentSuggestionsProvider implementation and deliver ContentSuggestions for the ARTICLES category. These ContentSuggestions are currently only delivered to the ContentSuggestionsService and not served to the UI, yet. Adjust NTPSnippetsServiceTest, SnippetsBridge and SnippetsInternals because of a few renamed functions. Change NTPSnippetsServiceFactory to register the NTPSnippetsService as a provder with the ContentSuggestionsService. BUG=619560 Committed: https://crrev.com/a6553c901b9663f2c3d63556f68fe4eccb730e03 Cr-Commit-Position: refs/heads/master@{#405103}

Patch Set 1 #

Total comments: 18

Patch Set 2 : Marcs comments #

Total comments: 4

Patch Set 3 : Change to constructor initialization #

Total comments: 4

Patch Set 4 : Marcs comments #

Total comments: 7

Patch Set 5 : Marcs new comments #

Patch Set 6 : Fixed renaming of LOADING to INITIALIZING #

Total comments: 2

Patch Set 7 : Only notify category status change if actually changed #

Total comments: 7

Patch Set 8 : Move comment from implementation to class definition #

Patch Set 9 : Ownership comment at ContentSuggestionsProvider::SetObserver #

Patch Set 10 : Rebased #

Patch Set 11 : Rename ERROR to LOADING_ERROR for compatibility with Windows compilers #

Patch Set 12 : Remove unnecessary default-case #

Patch Set 13 : Change from C-Style cast to static_cast #

Patch Set 14 : Insert the default-case again because some compilers need it #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+217 lines, -92 lines) Patch
M chrome/browser/android/ntp/ntp_snippets_bridge.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/ntp_snippets/ntp_snippets_service_factory.cc View 6 chunks +32 lines, -14 lines 0 comments Download
M chrome/browser/ui/webui/snippets_internals_message_handler.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M components/ntp_snippets/content_suggestions_category_status.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +8 lines, -3 lines 0 comments Download
M components/ntp_snippets/content_suggestions_provider.h View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -1 line 0 comments Download
M components/ntp_snippets/content_suggestions_provider.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -1 line 0 comments Download
M components/ntp_snippets/content_suggestions_service.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +2 lines, -2 lines 0 comments Download
M components/ntp_snippets/ntp_snippets_service.h View 1 2 3 4 5 6 7 8 9 10 8 chunks +42 lines, -19 lines 0 comments Download
M components/ntp_snippets/ntp_snippets_service.cc View 1 2 3 4 5 6 7 8 9 10 12 13 16 chunks +111 lines, -35 lines 2 comments Download
M components/ntp_snippets/ntp_snippets_service_unittest.cc View 11 chunks +12 lines, -13 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 51 (17 generated)
Philipp Keck
PTAL
4 years, 5 months ago (2016-07-08 13:09:34 UTC) #2
Marc Treib
Mostly looks good! https://codereview.chromium.org/2131943002/diff/1/components/ntp_snippets/content_suggestions_category_status.h File components/ntp_snippets/content_suggestions_category_status.h (right): https://codereview.chromium.org/2131943002/diff/1/components/ntp_snippets/content_suggestions_category_status.h#newcode16 components/ntp_snippets/content_suggestions_category_status.h:16: LOADING, Do we need both LOADING ...
4 years, 5 months ago (2016-07-08 13:26:03 UTC) #3
Philipp Keck
https://codereview.chromium.org/2131943002/diff/1/components/ntp_snippets/content_suggestions_category_status.h File components/ntp_snippets/content_suggestions_category_status.h (right): https://codereview.chromium.org/2131943002/diff/1/components/ntp_snippets/content_suggestions_category_status.h#newcode16 components/ntp_snippets/content_suggestions_category_status.h:16: LOADING, On 2016/07/08 13:26:02, Marc Treib wrote: > Do ...
4 years, 5 months ago (2016-07-08 14:02:55 UTC) #4
Marc Treib
https://codereview.chromium.org/2131943002/diff/1/components/ntp_snippets/content_suggestions_category_status.h File components/ntp_snippets/content_suggestions_category_status.h (right): https://codereview.chromium.org/2131943002/diff/1/components/ntp_snippets/content_suggestions_category_status.h#newcode16 components/ntp_snippets/content_suggestions_category_status.h:16: LOADING, On 2016/07/08 14:02:54, Philipp Keck wrote: > On ...
4 years, 5 months ago (2016-07-08 15:17:24 UTC) #5
Philipp Keck
https://codereview.chromium.org/2131943002/diff/1/components/ntp_snippets/content_suggestions_category_status.h File components/ntp_snippets/content_suggestions_category_status.h (right): https://codereview.chromium.org/2131943002/diff/1/components/ntp_snippets/content_suggestions_category_status.h#newcode16 components/ntp_snippets/content_suggestions_category_status.h:16: LOADING, On 2016/07/08 15:17:23, Marc Treib wrote: > On ...
4 years, 5 months ago (2016-07-08 16:17:02 UTC) #6
Marc Treib
https://codereview.chromium.org/2131943002/diff/1/components/ntp_snippets/ntp_snippets_service.h File components/ntp_snippets/ntp_snippets_service.h (right): https://codereview.chromium.org/2131943002/diff/1/components/ntp_snippets/ntp_snippets_service.h#newcode267 components/ntp_snippets/ntp_snippets_service.h:267: ContentSuggestionsCategoryStatus::LOADING; On 2016/07/08 16:17:01, Philipp Keck wrote: > On ...
4 years, 5 months ago (2016-07-11 08:41:33 UTC) #7
Philipp Keck
https://codereview.chromium.org/2131943002/diff/1/components/ntp_snippets/ntp_snippets_service.h File components/ntp_snippets/ntp_snippets_service.h (right): https://codereview.chromium.org/2131943002/diff/1/components/ntp_snippets/ntp_snippets_service.h#newcode267 components/ntp_snippets/ntp_snippets_service.h:267: ContentSuggestionsCategoryStatus::LOADING; On 2016/07/11 08:41:33, Marc Treib wrote: > On ...
4 years, 5 months ago (2016-07-11 09:41:49 UTC) #8
Marc Treib
https://codereview.chromium.org/2131943002/diff/60001/components/ntp_snippets/content_suggestions_category_status.h File components/ntp_snippets/content_suggestions_category_status.h (right): https://codereview.chromium.org/2131943002/diff/60001/components/ntp_snippets/content_suggestions_category_status.h#newcode16 components/ntp_snippets/content_suggestions_category_status.h:16: LOADING, Should this be INITIALIZING now? https://codereview.chromium.org/2131943002/diff/60001/components/ntp_snippets/ntp_snippets_service.cc File components/ntp_snippets/ntp_snippets_service.cc ...
4 years, 5 months ago (2016-07-11 10:12:04 UTC) #9
Philipp Keck
https://codereview.chromium.org/2131943002/diff/60001/components/ntp_snippets/content_suggestions_category_status.h File components/ntp_snippets/content_suggestions_category_status.h (right): https://codereview.chromium.org/2131943002/diff/60001/components/ntp_snippets/content_suggestions_category_status.h#newcode16 components/ntp_snippets/content_suggestions_category_status.h:16: LOADING, On 2016/07/11 10:12:04, Marc Treib wrote: > Should ...
4 years, 5 months ago (2016-07-11 10:30:56 UTC) #10
Marc Treib
lgtm https://codereview.chromium.org/2131943002/diff/100001/components/ntp_snippets/ntp_snippets_service.cc File components/ntp_snippets/ntp_snippets_service.cc (right): https://codereview.chromium.org/2131943002/diff/100001/components/ntp_snippets/ntp_snippets_service.cc#newcode767 components/ntp_snippets/ntp_snippets_service.cc:767: category_status_ = status; Should this be in an ...
4 years, 5 months ago (2016-07-11 10:40:02 UTC) #11
Philipp Keck
https://codereview.chromium.org/2131943002/diff/100001/components/ntp_snippets/ntp_snippets_service.cc File components/ntp_snippets/ntp_snippets_service.cc (right): https://codereview.chromium.org/2131943002/diff/100001/components/ntp_snippets/ntp_snippets_service.cc#newcode767 components/ntp_snippets/ntp_snippets_service.cc:767: category_status_ = status; On 2016/07/11 10:40:02, Marc Treib wrote: ...
4 years, 5 months ago (2016-07-11 10:45:14 UTC) #12
Philipp Keck
bauerb@chromium.org: Please review changes in snippets_internals_message_handler.cc.
4 years, 5 months ago (2016-07-11 10:46:08 UTC) #14
Bernhard Bauer
lgtm https://codereview.chromium.org/2131943002/diff/120001/components/ntp_snippets/ntp_snippets_service.cc File components/ntp_snippets/ntp_snippets_service.cc (right): https://codereview.chromium.org/2131943002/diff/120001/components/ntp_snippets/ntp_snippets_service.cc#newcode186 components/ntp_snippets/ntp_snippets_service.cc:186: // a subdirectory. This TODO might belong to ...
4 years, 5 months ago (2016-07-11 13:10:12 UTC) #15
Philipp Keck
https://codereview.chromium.org/2131943002/diff/120001/components/ntp_snippets/ntp_snippets_service.cc File components/ntp_snippets/ntp_snippets_service.cc (right): https://codereview.chromium.org/2131943002/diff/120001/components/ntp_snippets/ntp_snippets_service.cc#newcode186 components/ntp_snippets/ntp_snippets_service.cc:186: // a subdirectory. On 2016/07/11 13:10:12, Bernhard Bauer wrote: ...
4 years, 5 months ago (2016-07-11 13:25:01 UTC) #16
Marc Treib
https://codereview.chromium.org/2131943002/diff/120001/components/ntp_snippets/ntp_snippets_service.h File components/ntp_snippets/ntp_snippets_service.h (right): https://codereview.chromium.org/2131943002/diff/120001/components/ntp_snippets/ntp_snippets_service.h#newcode135 components/ntp_snippets/ntp_snippets_service.h:135: void SetObserver(Observer* observer) override; On 2016/07/11 13:25:01, Philipp Keck ...
4 years, 5 months ago (2016-07-11 13:38:31 UTC) #17
Bernhard Bauer
https://codereview.chromium.org/2131943002/diff/120001/components/ntp_snippets/ntp_snippets_service.h File components/ntp_snippets/ntp_snippets_service.h (right): https://codereview.chromium.org/2131943002/diff/120001/components/ntp_snippets/ntp_snippets_service.h#newcode135 components/ntp_snippets/ntp_snippets_service.h:135: void SetObserver(Observer* observer) override; On 2016/07/11 13:38:31, Marc Treib ...
4 years, 5 months ago (2016-07-11 15:13:18 UTC) #18
Philipp Keck
https://codereview.chromium.org/2131943002/diff/120001/components/ntp_snippets/ntp_snippets_service.h File components/ntp_snippets/ntp_snippets_service.h (right): https://codereview.chromium.org/2131943002/diff/120001/components/ntp_snippets/ntp_snippets_service.h#newcode135 components/ntp_snippets/ntp_snippets_service.h:135: void SetObserver(Observer* observer) override; On 2016/07/11 15:13:18, Bernhard Bauer ...
4 years, 5 months ago (2016-07-11 15:33:03 UTC) #19
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/2131943002/160001
4 years, 5 months ago (2016-07-11 15:39:25 UTC) #22
commit-bot: I haz the power
Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds/33522) ios-device-gn on master.tryserver.chromium.mac (JOB_FAILED, ...
4 years, 5 months ago (2016-07-11 15:41:08 UTC) #24
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/2131943002/180001
4 years, 5 months ago (2016-07-11 16:40:07 UTC) #27
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_compile_dbg_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_compile_dbg_ng/builds/218748)
4 years, 5 months ago (2016-07-11 17:02:42 UTC) #29
Philipp Keck
@treib PTAL at last patch set.
4 years, 5 months ago (2016-07-12 07:58:54 UTC) #30
Marc Treib
On 2016/07/12 07:58:54, Philipp Keck wrote: > @treib PTAL at last patch set. Windows compilers ...
4 years, 5 months ago (2016-07-12 08:02:41 UTC) #31
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/2131943002/200001
4 years, 5 months ago (2016-07-12 08:03:54 UTC) #34
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/191086)
4 years, 5 months ago (2016-07-12 10:06:21 UTC) #36
Philipp Keck
Implemented two small changes discussed here: https://codereview.chromium.org/2145563002/diff/1/chrome/browser/ui/webui/snippets_internals_message_handler.cc#newcode80
4 years, 5 months ago (2016-07-12 15:05:07 UTC) #37
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/2131943002/240001
4 years, 5 months ago (2016-07-12 15:17:12 UTC) #40
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_compile_dbg_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_compile_dbg_ng/builds/219518)
4 years, 5 months ago (2016-07-12 15:51:11 UTC) #42
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/2131943002/260001
4 years, 5 months ago (2016-07-13 08:43:48 UTC) #45
Marc Treib
https://codereview.chromium.org/2131943002/diff/260001/components/ntp_snippets/ntp_snippets_service.cc File components/ntp_snippets/ntp_snippets_service.cc (right): https://codereview.chromium.org/2131943002/diff/260001/components/ntp_snippets/ntp_snippets_service.cc#newcode752 components/ntp_snippets/ntp_snippets_service.cc:752: new_status = ContentSuggestionsCategoryStatus::LOADING_ERROR; The Win compiler doesn't really need ...
4 years, 5 months ago (2016-07-13 08:49:43 UTC) #46
commit-bot: I haz the power
Committed patchset #14 (id:260001)
4 years, 5 months ago (2016-07-13 09:20:50 UTC) #47
commit-bot: I haz the power
CQ bit was unchecked.
4 years, 5 months ago (2016-07-13 09:21:01 UTC) #48
commit-bot: I haz the power
Patchset 14 (id:??) landed as https://crrev.com/a6553c901b9663f2c3d63556f68fe4eccb730e03 Cr-Commit-Position: refs/heads/master@{#405103}
4 years, 5 months ago (2016-07-13 09:22:49 UTC) #50
Philipp Keck
4 years, 5 months ago (2016-07-13 09:52:10 UTC) #51
Message was sent while issue was closed.
https://codereview.chromium.org/2131943002/diff/260001/components/ntp_snippet...
File components/ntp_snippets/ntp_snippets_service.cc (right):

https://codereview.chromium.org/2131943002/diff/260001/components/ntp_snippet...
components/ntp_snippets/ntp_snippets_service.cc:752: new_status =
ContentSuggestionsCategoryStatus::LOADING_ERROR;
On 2016/07/13 08:49:43, Marc Treib wrote:
> The Win compiler doesn't really need the default case, it just wants new_state
> and new_status to be initialized, which you could do above (before the
switch).
> (Not important enough to cancel the commit, we can change this later)

I will include this in the next CL.

Powered by Google App Engine
This is Rietveld 408576698