New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 632320 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Email to this user bounced
Closed: Aug 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Feature

Blocked on:
issue 619560
issue 632690

Blocking:
issue 635794



Sign in to add a comment

Support dynamic adding, ordering and removing of suggestion categories

Project Member Reported by pke@google.com, Jul 28 2016

Issue description

ContentSuggestionsProviders should be able to provide content suggestions for categories that were not known at compile time. Local categories are always at the top, dynamically added remote categories are reported to the UI in the order they were added. The providers also need to provide titles (and possibly other information) for their categories.
 
Project Member

Comment 1 by sheriffbot@chromium.org, Jul 28 2016

Labels: Hotlist-Google

Comment 2 by pke@google.com, Jul 29 2016

Blockedon: 632690

Comment 3 by pke@google.com, Aug 1 2016

Labels: zine-16-08-01
Project Member

Comment 4 by bugdroid1@chromium.org, Aug 1 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/31b07944fef8601f52778ce509ac8a5059bfd853

commit 31b07944fef8601f52778ce509ac8a5059bfd853
Author: pke <pke@google.com>
Date: Mon Aug 01 11:35:02 2016

Add ContentSuggestionsCategoryFactory; Store categories as ints

Replace the ContentSuggestionsCategory enum with a thin wrapper class
around an int to allow for categories to be added dynamically at
runtime. Add a ContentSuggestionsCategoryFactory, which creates
instances and keeps track of the ordering of the categories.

Adjust the ContentSuggestionsService to use the category ordering
provided by the new factory. Adjust ContentSuggestionsProvider to use
the factory for recovering categories from combined IDs and move the
provided_categories_ field to subclasses. Adjust the SnippetsBridge
to use the new factory.

BUG= 632320 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2187233002
Cr-Commit-Position: refs/heads/master@{#408942}

[modify] https://crrev.com/31b07944fef8601f52778ce509ac8a5059bfd853/chrome/browser/android/ntp/ntp_snippets_bridge.cc
[modify] https://crrev.com/31b07944fef8601f52778ce509ac8a5059bfd853/chrome/browser/android/ntp/offline_page_suggestions_provider_factory.cc
[modify] https://crrev.com/31b07944fef8601f52778ce509ac8a5059bfd853/chrome/browser/ntp_snippets/ntp_snippets_service_factory.cc
[modify] https://crrev.com/31b07944fef8601f52778ce509ac8a5059bfd853/chrome/browser/resources/snippets_internals.html
[modify] https://crrev.com/31b07944fef8601f52778ce509ac8a5059bfd853/chrome/browser/ui/webui/snippets_internals_message_handler.cc
[modify] https://crrev.com/31b07944fef8601f52778ce509ac8a5059bfd853/components/ntp_snippets.gypi
[modify] https://crrev.com/31b07944fef8601f52778ce509ac8a5059bfd853/components/ntp_snippets/BUILD.gn
[add] https://crrev.com/31b07944fef8601f52778ce509ac8a5059bfd853/components/ntp_snippets/content_suggestions_category.cc
[modify] https://crrev.com/31b07944fef8601f52778ce509ac8a5059bfd853/components/ntp_snippets/content_suggestions_category.h
[add] https://crrev.com/31b07944fef8601f52778ce509ac8a5059bfd853/components/ntp_snippets/content_suggestions_category_factory.cc
[add] https://crrev.com/31b07944fef8601f52778ce509ac8a5059bfd853/components/ntp_snippets/content_suggestions_category_factory.h
[modify] https://crrev.com/31b07944fef8601f52778ce509ac8a5059bfd853/components/ntp_snippets/content_suggestions_category_status.h
[modify] https://crrev.com/31b07944fef8601f52778ce509ac8a5059bfd853/components/ntp_snippets/content_suggestions_provider.cc
[modify] https://crrev.com/31b07944fef8601f52778ce509ac8a5059bfd853/components/ntp_snippets/content_suggestions_provider.h
[modify] https://crrev.com/31b07944fef8601f52778ce509ac8a5059bfd853/components/ntp_snippets/content_suggestions_service.cc
[modify] https://crrev.com/31b07944fef8601f52778ce509ac8a5059bfd853/components/ntp_snippets/content_suggestions_service.h
[modify] https://crrev.com/31b07944fef8601f52778ce509ac8a5059bfd853/components/ntp_snippets/content_suggestions_service_unittest.cc
[modify] https://crrev.com/31b07944fef8601f52778ce509ac8a5059bfd853/components/ntp_snippets/ntp_snippets_service.cc
[modify] https://crrev.com/31b07944fef8601f52778ce509ac8a5059bfd853/components/ntp_snippets/ntp_snippets_service.h
[modify] https://crrev.com/31b07944fef8601f52778ce509ac8a5059bfd853/components/ntp_snippets/ntp_snippets_service_unittest.cc
[modify] https://crrev.com/31b07944fef8601f52778ce509ac8a5059bfd853/components/ntp_snippets/offline_pages/offline_page_suggestions_provider.cc
[modify] https://crrev.com/31b07944fef8601f52778ce509ac8a5059bfd853/components/ntp_snippets/offline_pages/offline_page_suggestions_provider.h

Comment 5 by fi...@chromium.org, Aug 1 2016

Labels: zine-client-sections-v1
Project Member

Comment 6 by bugdroid1@chromium.org, Aug 2 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4d3a4d66ed9290eec918786cd7457ef1bf46e0dc

commit 4d3a4d66ed9290eec918786cd7457ef1bf46e0dc
Author: pke <pke@google.com>
Date: Tue Aug 02 09:06:21 2016

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 

Review-Url: https://codereview.chromium.org/2194203002
Cr-Commit-Position: refs/heads/master@{#409160}

[modify] https://crrev.com/4d3a4d66ed9290eec918786cd7457ef1bf46e0dc/components/ntp_snippets/category.h
[modify] https://crrev.com/4d3a4d66ed9290eec918786cd7457ef1bf46e0dc/components/ntp_snippets/content_suggestions_provider.h
[modify] https://crrev.com/4d3a4d66ed9290eec918786cd7457ef1bf46e0dc/components/ntp_snippets/content_suggestions_service.cc
[modify] https://crrev.com/4d3a4d66ed9290eec918786cd7457ef1bf46e0dc/components/ntp_snippets/content_suggestions_service.h
[modify] https://crrev.com/4d3a4d66ed9290eec918786cd7457ef1bf46e0dc/components/ntp_snippets/content_suggestions_service_unittest.cc
[modify] https://crrev.com/4d3a4d66ed9290eec918786cd7457ef1bf46e0dc/components/ntp_snippets/ntp_snippets_service.cc
[modify] https://crrev.com/4d3a4d66ed9290eec918786cd7457ef1bf46e0dc/components/ntp_snippets/offline_pages/offline_page_suggestions_provider.cc

Comment 7 by fi...@chromium.org, Aug 4 2016

Labels: zine-triaged

Comment 8 by pke@google.com, Aug 8 2016

Labels: zine-16-08-08

Comment 9 by pke@google.com, Aug 9 2016

Blocking: 635794
Project Member

Comment 10 by bugdroid1@chromium.org, Aug 9 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bd2f650a67858b6b88ddbd1c7edd4833e55fabed

commit bd2f650a67858b6b88ddbd1c7edd4833e55fabed
Author: pke <pke@google.com>
Date: Tue Aug 09 14:53:45 2016

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 

Review-Url: https://codereview.chromium.org/2207493002
Cr-Commit-Position: refs/heads/master@{#410672}

[modify] https://crrev.com/bd2f650a67858b6b88ddbd1c7edd4833e55fabed/chrome/browser/ui/webui/snippets_internals_message_handler.cc
[modify] https://crrev.com/bd2f650a67858b6b88ddbd1c7edd4833e55fabed/components/ntp_snippets.gypi
[modify] https://crrev.com/bd2f650a67858b6b88ddbd1c7edd4833e55fabed/components/ntp_snippets/BUILD.gn
[modify] https://crrev.com/bd2f650a67858b6b88ddbd1c7edd4833e55fabed/components/ntp_snippets/DEPS
[modify] https://crrev.com/bd2f650a67858b6b88ddbd1c7edd4833e55fabed/components/ntp_snippets/bookmarks/bookmark_suggestions_provider.cc
[modify] https://crrev.com/bd2f650a67858b6b88ddbd1c7edd4833e55fabed/components/ntp_snippets/bookmarks/bookmark_suggestions_provider.h
[add] https://crrev.com/bd2f650a67858b6b88ddbd1c7edd4833e55fabed/components/ntp_snippets/category_info.cc
[add] https://crrev.com/bd2f650a67858b6b88ddbd1c7edd4833e55fabed/components/ntp_snippets/category_info.h
[modify] https://crrev.com/bd2f650a67858b6b88ddbd1c7edd4833e55fabed/components/ntp_snippets/content_suggestions_provider.h
[modify] https://crrev.com/bd2f650a67858b6b88ddbd1c7edd4833e55fabed/components/ntp_snippets/content_suggestions_service.cc
[modify] https://crrev.com/bd2f650a67858b6b88ddbd1c7edd4833e55fabed/components/ntp_snippets/content_suggestions_service.h
[modify] https://crrev.com/bd2f650a67858b6b88ddbd1c7edd4833e55fabed/components/ntp_snippets/content_suggestions_service_unittest.cc
[modify] https://crrev.com/bd2f650a67858b6b88ddbd1c7edd4833e55fabed/components/ntp_snippets/ntp_snippets_service.cc
[modify] https://crrev.com/bd2f650a67858b6b88ddbd1c7edd4833e55fabed/components/ntp_snippets/ntp_snippets_service.h
[modify] https://crrev.com/bd2f650a67858b6b88ddbd1c7edd4833e55fabed/components/ntp_snippets/offline_pages/offline_page_suggestions_provider.cc
[modify] https://crrev.com/bd2f650a67858b6b88ddbd1c7edd4833e55fabed/components/ntp_snippets/offline_pages/offline_page_suggestions_provider.h
[modify] https://crrev.com/bd2f650a67858b6b88ddbd1c7edd4833e55fabed/components/ntp_snippets_strings.grdp

Project Member

Comment 11 by bugdroid1@chromium.org, Aug 12 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3b2e36375f8c0079121f4988c24ca1c4c6d303a7

commit 3b2e36375f8c0079121f4988c24ca1c4c6d303a7
Author: pke <pke@google.com>
Date: Fri Aug 12 12:52:53 2016

Support action button to fetch more content suggestions

Add has_more_button flag to CategoryInfo.
Add FetchMoreSuggestions method to the provider and service interface.
Update all existing provider implementations accordingly.
Provide the new flag and the new method over the SnippetsBridge.
Change ActionListItem to call the new method (or a hard-coded UI
action) depending on the category.
Enable the more-button for the bookmarks-section only.

BUG= 632320 , 635794 

Review-Url: https://codereview.chromium.org/2232783002
Cr-Commit-Position: refs/heads/master@{#411624}

[modify] https://crrev.com/3b2e36375f8c0079121f4988c24ca1c4c6d303a7/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/ActionListItem.java
[modify] https://crrev.com/3b2e36375f8c0079121f4988c24ca1c4c6d303a7/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java
[modify] https://crrev.com/3b2e36375f8c0079121f4988c24ca1c4c6d303a7/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsCategoryInfo.java
[modify] https://crrev.com/3b2e36375f8c0079121f4988c24ca1c4c6d303a7/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java
[modify] https://crrev.com/3b2e36375f8c0079121f4988c24ca1c4c6d303a7/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsBridge.java
[modify] https://crrev.com/3b2e36375f8c0079121f4988c24ca1c4c6d303a7/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SuggestionsSource.java
[modify] https://crrev.com/3b2e36375f8c0079121f4988c24ca1c4c6d303a7/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapterTest.java
[modify] https://crrev.com/3b2e36375f8c0079121f4988c24ca1c4c6d303a7/chrome/browser/android/ntp/ntp_snippets_bridge.cc
[modify] https://crrev.com/3b2e36375f8c0079121f4988c24ca1c4c6d303a7/components/ntp_snippets/bookmarks/bookmark_suggestions_provider.cc
[modify] https://crrev.com/3b2e36375f8c0079121f4988c24ca1c4c6d303a7/components/ntp_snippets/category_info.cc
[modify] https://crrev.com/3b2e36375f8c0079121f4988c24ca1c4c6d303a7/components/ntp_snippets/category_info.h
[modify] https://crrev.com/3b2e36375f8c0079121f4988c24ca1c4c6d303a7/components/ntp_snippets/content_suggestions_service.cc
[modify] https://crrev.com/3b2e36375f8c0079121f4988c24ca1c4c6d303a7/components/ntp_snippets/content_suggestions_service_unittest.cc
[modify] https://crrev.com/3b2e36375f8c0079121f4988c24ca1c4c6d303a7/components/ntp_snippets/ntp_snippets_service.cc
[modify] https://crrev.com/3b2e36375f8c0079121f4988c24ca1c4c6d303a7/components/ntp_snippets/offline_pages/offline_page_suggestions_provider.cc

Comment 12 by pke@google.com, Aug 12 2016

Status: Fixed (was: Started)

Sign in to add a comment