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

Issue 2207493002: Add CategoryInfo for meta information of content suggestions Categories (Closed)

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

Description

Add CategoryInfo for meta information of content suggestions Categories Apart from the ContentSuggestions in a Category and its current status, there is meta information assigned with a Category that does not change even for dynamically added categories. This information includes the title, for example. Implement a new CategoryInfo struct (with currently only the title and a card_layout field) and corresponding methods to hand the information from the ContentSuggestionsProviders to the ContentSuggestionsService and out towards the UI. Implement those methods in the three providers we currently have. For the offline pages, only use a placeholder string at the moment, because it will provide two distinct categories with different titles in the future. BUG=632320 Committed: https://crrev.com/bd2f650a67858b6b88ddbd1c7edd4833e55fabed Cr-Commit-Position: refs/heads/master@{#410672}

Patch Set 1 #

Patch Set 2 : Rebase #

Total comments: 11

Patch Set 3 : Remove unnecessary include #

Total comments: 8

Patch Set 4 : Peter's comments #

Patch Set 5 : Add ContentSuggestionsCardLayout #

Total comments: 8

Patch Set 6 : Marc's comments #

Patch Set 7 : Use base::Optional for ContentSuggestionsService::GetCategoryInfo #

Total comments: 10

Patch Set 8 : Use localized string for Recent bookmarks header #

Patch Set 9 : Rebase #

Patch Set 10 : DCHECK against empty base::Optional<CategoryInfo> in SnippetsInternals #

Unified diffs Side-by-side diffs Delta from patch set Stats (+140 lines, -17 lines) Patch
M chrome/browser/ui/webui/snippets_internals_message_handler.cc View 1 2 3 4 5 6 7 8 9 5 chunks +7 lines, -15 lines 0 comments Download
M components/ntp_snippets.gypi View 1 2 3 4 2 chunks +3 lines, -0 lines 0 comments Download
M components/ntp_snippets/BUILD.gn View 1 2 3 4 4 chunks +6 lines, -0 lines 0 comments Download
M components/ntp_snippets/DEPS View 1 chunk +2 lines, -0 lines 0 comments Download
M components/ntp_snippets/bookmarks/bookmark_suggestions_provider.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M components/ntp_snippets/bookmarks/bookmark_suggestions_provider.cc View 1 2 3 4 5 6 7 8 2 chunks +8 lines, -0 lines 0 comments Download
A components/ntp_snippets/category_info.h View 1 2 3 4 1 chunk +48 lines, -0 lines 0 comments Download
A components/ntp_snippets/category_info.cc View 1 2 3 4 1 chunk +15 lines, -0 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, -0 lines 0 comments Download
M components/ntp_snippets/content_suggestions_service.h View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -0 lines 0 comments Download
M components/ntp_snippets/content_suggestions_service.cc View 1 2 3 4 5 6 7 8 1 chunk +8 lines, -0 lines 0 comments Download
M components/ntp_snippets/content_suggestions_service_unittest.cc View 1 2 3 4 5 6 7 8 2 chunks +7 lines, -0 lines 0 comments Download
M components/ntp_snippets/ntp_snippets_service.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M components/ntp_snippets/ntp_snippets_service.cc View 1 2 3 4 5 6 7 8 2 chunks +8 lines, -0 lines 0 comments Download
M components/ntp_snippets/offline_pages/offline_page_suggestions_provider.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M components/ntp_snippets/offline_pages/offline_page_suggestions_provider.cc View 1 2 3 4 5 6 7 8 1 chunk +7 lines, -0 lines 0 comments Download
M components/ntp_snippets_strings.grdp View 1 2 3 4 5 6 7 1 chunk +10 lines, -2 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 47 (17 generated)
Philipp Keck
PTAL
4 years, 4 months ago (2016-08-04 08:11:12 UTC) #3
tschumann
https://codereview.chromium.org/2207493002/diff/20001/components/ntp_snippets/content_suggestions_service.cc File components/ntp_snippets/content_suggestions_service.cc (right): https://codereview.chromium.org/2207493002/diff/20001/components/ntp_snippets/content_suggestions_service.cc#newcode55 components/ntp_snippets/content_suggestions_service.cc:55: return CategoryInfo(base::string16()); it might be better to explicitly signal ...
4 years, 4 months ago (2016-08-04 08:59:39 UTC) #5
Marc Treib
Please remove the "----" line from the description (the first line of the description will ...
4 years, 4 months ago (2016-08-04 09:46:30 UTC) #6
Philipp Keck
https://codereview.chromium.org/2207493002/diff/20001/components/ntp_snippets/category_info.h File components/ntp_snippets/category_info.h (right): https://codereview.chromium.org/2207493002/diff/20001/components/ntp_snippets/category_info.h#newcode18 components/ntp_snippets/category_info.h:18: CategoryInfo& operator=(CategoryInfo&&); On 2016/08/04 09:46:29, Marc Treib wrote: > ...
4 years, 4 months ago (2016-08-04 11:48:18 UTC) #8
tschumann
https://codereview.chromium.org/2207493002/diff/20001/components/ntp_snippets/content_suggestions_service.cc File components/ntp_snippets/content_suggestions_service.cc (right): https://codereview.chromium.org/2207493002/diff/20001/components/ntp_snippets/content_suggestions_service.cc#newcode55 components/ntp_snippets/content_suggestions_service.cc:55: return CategoryInfo(base::string16()); On 2016/08/04 11:48:18, Philipp Keck wrote: > ...
4 years, 4 months ago (2016-08-04 11:51:24 UTC) #9
PEConn
There's a typo in the issue description: these is meta information | V there is ...
4 years, 4 months ago (2016-08-04 12:08:39 UTC) #11
Philipp Keck
Addressed PEConn1's comments, fixed typo in issue description. On 2016/08/04 11:51:24, tschumann wrote: > https://codereview.chromium.org/2207493002/diff/20001/components/ntp_snippets/content_suggestions_service.cc ...
4 years, 4 months ago (2016-08-04 14:17:43 UTC) #13
Philipp Keck
PTAL again. Added card_layout, implemented the new methods for the BookmarkSuggestionsProvider.
4 years, 4 months ago (2016-08-08 13:25:39 UTC) #15
PEConn
https://codereview.chromium.org/2207493002/diff/80001/components/ntp_snippets/category_info.h File components/ntp_snippets/category_info.h (right): https://codereview.chromium.org/2207493002/diff/80001/components/ntp_snippets/category_info.h#newcode15 components/ntp_snippets/category_info.h:15: enum class ContentSuggestionsCardLayout { Was there more of a ...
4 years, 4 months ago (2016-08-08 13:50:05 UTC) #16
Philipp Keck
On 2016/08/08 13:50:05, PEConn1 wrote: > https://codereview.chromium.org/2207493002/diff/80001/components/ntp_snippets/category_info.h > File components/ntp_snippets/category_info.h (right): > > https://codereview.chromium.org/2207493002/diff/80001/components/ntp_snippets/category_info.h#newcode15 > ...
4 years, 4 months ago (2016-08-08 13:53:49 UTC) #17
Marc Treib
https://codereview.chromium.org/2207493002/diff/80001/components/ntp_snippets/content_suggestions_service.cc File components/ntp_snippets/content_suggestions_service.cc (right): https://codereview.chromium.org/2207493002/diff/80001/components/ntp_snippets/content_suggestions_service.cc#newcode53 components/ntp_snippets/content_suggestions_service.cc:53: CategoryInfo ContentSuggestionsService::GetCategoryInfo( Didn't we agree on returning a base::Optional? ...
4 years, 4 months ago (2016-08-08 14:11:27 UTC) #18
Philipp Keck
https://codereview.chromium.org/2207493002/diff/20001/components/ntp_snippets/content_suggestions_service.cc File components/ntp_snippets/content_suggestions_service.cc (right): https://codereview.chromium.org/2207493002/diff/20001/components/ntp_snippets/content_suggestions_service.cc#newcode55 components/ntp_snippets/content_suggestions_service.cc:55: return CategoryInfo(base::string16()); On 2016/08/04 11:51:24, tschumann wrote: > On ...
4 years, 4 months ago (2016-08-08 14:50:18 UTC) #19
Marc Treib
LGTM from my end. The "enum vs two bools" discussion still needs to be resolved. ...
4 years, 4 months ago (2016-08-08 14:54:41 UTC) #20
Philipp Keck
bauerb@chromium.org: Please review changes in chrome/browser/ui/webui/snippets_internals_message_handler.cc
4 years, 4 months ago (2016-08-09 08:02:09 UTC) #22
Philipp Keck
Conclusion from Hangouts chat: We're using the enums as implemented above for now.
4 years, 4 months ago (2016-08-09 08:02:51 UTC) #23
Bernhard Bauer
https://codereview.chromium.org/2207493002/diff/120001/chrome/browser/ui/webui/snippets_internals_message_handler.cc File chrome/browser/ui/webui/snippets_internals_message_handler.cc (right): https://codereview.chromium.org/2207493002/diff/120001/chrome/browser/ui/webui/snippets_internals_message_handler.cc#newcode323 chrome/browser/ui/webui/snippets_internals_message_handler.cc:323: if (!info) This shouldn't really happen if we're iterating ...
4 years, 4 months ago (2016-08-09 09:18:33 UTC) #24
Marc Treib
https://codereview.chromium.org/2207493002/diff/120001/components/ntp_snippets/content_suggestions_service.h File components/ntp_snippets/content_suggestions_service.h (right): https://codereview.chromium.org/2207493002/diff/120001/components/ntp_snippets/content_suggestions_service.h#newcode83 components/ntp_snippets/content_suggestions_service.h:83: base::Optional<CategoryInfo> GetCategoryInfo(Category category) const; On 2016/08/09 09:18:33, Bernhard Bauer ...
4 years, 4 months ago (2016-08-09 09:45:12 UTC) #25
Philipp Keck
https://codereview.chromium.org/2207493002/diff/120001/components/ntp_snippets/content_suggestions_service.h File components/ntp_snippets/content_suggestions_service.h (right): https://codereview.chromium.org/2207493002/diff/120001/components/ntp_snippets/content_suggestions_service.h#newcode83 components/ntp_snippets/content_suggestions_service.h:83: base::Optional<CategoryInfo> GetCategoryInfo(Category category) const; On 2016/08/09 09:45:12, Marc Treib ...
4 years, 4 months ago (2016-08-09 10:03:06 UTC) #26
Bernhard Bauer
https://codereview.chromium.org/2207493002/diff/120001/components/ntp_snippets/bookmarks/bookmark_suggestions_provider.cc File components/ntp_snippets/bookmarks/bookmark_suggestions_provider.cc (right): https://codereview.chromium.org/2207493002/diff/120001/components/ntp_snippets/bookmarks/bookmark_suggestions_provider.cc#newcode69 components/ntp_snippets/bookmarks/bookmark_suggestions_provider.cc:69: return CategoryInfo(base::ASCIIToUTF16("Recent bookmarks"), I think you could already now ...
4 years, 4 months ago (2016-08-09 10:25:41 UTC) #27
Philipp Keck
https://codereview.chromium.org/2207493002/diff/120001/components/ntp_snippets/content_suggestions_service.h File components/ntp_snippets/content_suggestions_service.h (right): https://codereview.chromium.org/2207493002/diff/120001/components/ntp_snippets/content_suggestions_service.h#newcode83 components/ntp_snippets/content_suggestions_service.h:83: base::Optional<CategoryInfo> GetCategoryInfo(Category category) const; On 2016/08/09 10:25:41, Bernhard Bauer ...
4 years, 4 months ago (2016-08-09 11:24:27 UTC) #28
Philipp Keck
https://codereview.chromium.org/2207493002/diff/120001/components/ntp_snippets/bookmarks/bookmark_suggestions_provider.cc File components/ntp_snippets/bookmarks/bookmark_suggestions_provider.cc (right): https://codereview.chromium.org/2207493002/diff/120001/components/ntp_snippets/bookmarks/bookmark_suggestions_provider.cc#newcode69 components/ntp_snippets/bookmarks/bookmark_suggestions_provider.cc:69: return CategoryInfo(base::ASCIIToUTF16("Recent bookmarks"), On 2016/08/09 10:25:41, Bernhard Bauer wrote: ...
4 years, 4 months ago (2016-08-09 12:26:58 UTC) #29
Bernhard Bauer
On 2016/08/09 11:24:27, Philipp Keck wrote: > The callsites will change soon: > https://codereview.chromium.org/2230473002/diff/1/chrome/browser/android/ntp/ntp_snippets_bridge.cc#newcode121 > ...
4 years, 4 months ago (2016-08-09 12:38:40 UTC) #30
Philipp Keck
https://codereview.chromium.org/2207493002/diff/120001/chrome/browser/ui/webui/snippets_internals_message_handler.cc File chrome/browser/ui/webui/snippets_internals_message_handler.cc (right): https://codereview.chromium.org/2207493002/diff/120001/chrome/browser/ui/webui/snippets_internals_message_handler.cc#newcode323 chrome/browser/ui/webui/snippets_internals_message_handler.cc:323: if (!info) On 2016/08/09 09:18:33, Bernhard Bauer wrote: > ...
4 years, 4 months ago (2016-08-09 12:45:14 UTC) #31
Philipp Keck
sadrul@chromium.org: Please review the changes to DEPS.
4 years, 4 months ago (2016-08-09 12:56:37 UTC) #33
Bernhard Bauer
lgtm
4 years, 4 months ago (2016-08-09 12:59:11 UTC) #34
PEConn
LGTM
4 years, 4 months ago (2016-08-09 14:00:00 UTC) #39
sadrul
On 2016/08/09 12:56:37, Philipp Keck wrote: > mailto:sadrul@chromium.org: Please review the changes to DEPS. lgtm
4 years, 4 months ago (2016-08-09 14:46:52 UTC) #40
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/2207493002/180001
4 years, 4 months ago (2016-08-09 14:49:44 UTC) #43
commit-bot: I haz the power
Committed patchset #10 (id:180001)
4 years, 4 months ago (2016-08-09 14:54:12 UTC) #45
commit-bot: I haz the power
4 years, 4 months ago (2016-08-09 14:59:05 UTC) #47
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/bd2f650a67858b6b88ddbd1c7edd4833e55fabed
Cr-Commit-Position: refs/heads/master@{#410672}

Powered by Google App Engine
This is Rietveld 408576698