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

Issue 2276383002: Support server-provided category names. (Closed)

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

Description

Support server-provided category names. BUG=633613

Patch Set 1 #

Total comments: 8

Patch Set 2 : No "new_snippets" var. #

Patch Set 3 : Move "ignored" comment. #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+69 lines, -34 lines) Patch
M components/ntp_snippets/ntp_snippet.h View 1 chunk +0 lines, -1 line 0 comments Download
M components/ntp_snippets/ntp_snippets_fetcher.h View 1 2 2 chunks +14 lines, -2 lines 0 comments Download
M components/ntp_snippets/ntp_snippets_fetcher.cc View 5 chunks +29 lines, -14 lines 0 comments Download
M components/ntp_snippets/ntp_snippets_fetcher_unittest.cc View 3 chunks +7 lines, -6 lines 0 comments Download
M components/ntp_snippets/ntp_snippets_service.h View 1 2 1 chunk +3 lines, -0 lines 2 comments Download
M components/ntp_snippets/ntp_snippets_service.cc View 1 4 chunks +16 lines, -11 lines 2 comments Download

Messages

Total messages: 15 (9 generated)
sfiera
Small missing thing! Have you gone home or just to dinner?
4 years, 3 months ago (2016-08-25 16:02:50 UTC) #4
Marc Treib
lgtm https://codereview.chromium.org/2276383002/diff/1/components/ntp_snippets/ntp_snippets_fetcher.cc File components/ntp_snippets/ntp_snippets_fetcher.cc (right): https://codereview.chromium.org/2276383002/diff/1/components/ntp_snippets/ntp_snippets_fetcher.cc#newcode162 components/ntp_snippets/ntp_snippets_fetcher.cc:162: operator=(FetchedCategory&&) = default; Is this the correct way ...
4 years, 3 months ago (2016-08-25 16:33:12 UTC) #5
tschumann
https://codereview.chromium.org/2276383002/diff/1/components/ntp_snippets/ntp_snippets_service.h File components/ntp_snippets/ntp_snippets_service.h (right): https://codereview.chromium.org/2276383002/diff/1/components/ntp_snippets/ntp_snippets_service.h#newcode299 components/ntp_snippets/ntp_snippets_service.h:299: // running UI language. Ignored for categories known to ...
4 years, 3 months ago (2016-08-25 16:46:31 UTC) #6
sfiera
https://codereview.chromium.org/2276383002/diff/1/components/ntp_snippets/ntp_snippets_fetcher.cc File components/ntp_snippets/ntp_snippets_fetcher.cc (right): https://codereview.chromium.org/2276383002/diff/1/components/ntp_snippets/ntp_snippets_fetcher.cc#newcode162 components/ntp_snippets/ntp_snippets_fetcher.cc:162: operator=(FetchedCategory&&) = default; On 2016/08/25 16:33:11, Marc Treib wrote: ...
4 years, 3 months ago (2016-08-26 09:16:15 UTC) #7
tschumann
https://codereview.chromium.org/2276383002/diff/40001/components/ntp_snippets/ntp_snippets_service.cc File components/ntp_snippets/ntp_snippets_service.cc (right): https://codereview.chromium.org/2276383002/diff/40001/components/ntp_snippets/ntp_snippets_service.cc#newcode565 components/ntp_snippets/ntp_snippets_service.cc:565: if (category != articles_category_) { note: special casing the ...
4 years, 3 months ago (2016-08-29 09:59:53 UTC) #8
Michael van Ouwerkerk
4 years, 3 months ago (2016-09-08 13:03:27 UTC) #14
I'm continuing this CL in:
https://codereview.chromium.org/2325473003

Thanks!

https://codereview.chromium.org/2276383002/diff/40001/components/ntp_snippets...
File components/ntp_snippets/ntp_snippets_service.cc (right):

https://codereview.chromium.org/2276383002/diff/40001/components/ntp_snippets...
components/ntp_snippets/ntp_snippets_service.cc:565: if (category !=
articles_category_) {
On 2016/08/29 09:59:53, tschumann wrote:
> note: special casing the articles category like this is probably fine for now,
> but we should find a better way at some point (right now, we hard-code this
> here, in the constructor and maybe in other places).
> 
> It might also be cleaner to make the original intent clear,like only updating
> titles for server-side categories. e.g.
> if (!category.IsKnownCategory(KnownCategories::ARTICLES)) {
>   // Only update titles from server-side provided categories.
>   ...
> }

The form of "category != articles_category_" is used throughout this file, so
for consistency I'll keep that. The comment seems a good idea, done.

https://codereview.chromium.org/2276383002/diff/40001/components/ntp_snippets...
File components/ntp_snippets/ntp_snippets_service.h (right):

https://codereview.chromium.org/2276383002/diff/40001/components/ntp_snippets...
components/ntp_snippets/ntp_snippets_service.h:295: struct CategoryContent {
On 2016/08/29 09:59:53, tschumann wrote:
> this struct has some overlap with CategoryInfo.
> Would be cleaner to store a CategoryInfo object inside the CategoryContent
IMO.

I've added a TODO to consider this for a followup CL.

Powered by Google App Engine
This is Rietveld 408576698