[NTP::Push] Unsubscribe when suggestions are disabled

Desktop / Chromium - Vitalii Iarko [chromium.org] - 9 August 2017 05:59 EDT

Before this CL, the RemoteSuggestionsProviderImpl just started to listen for BreakingNews no matter what in the constructor.

After this CL:- On startup it starts listening only if suggestions are enabled in settings.
- During the runtime it starts listening when suggestions are enabled.
- It stops listening when they are disabled.

The signals are provided by RemoteSuggestionsStatusService.

Bug: 752868 Change-Id: I17fda689da77f84f70fe1349b496bfb3af9cce8b Reviewed-on: https://chromium-review.googlesource.com/605251 Commit-Queue: vitaliii

be4d278 [NTP::Push] Unsubscribe when suggestions are disabled.
.../breaking_news/breaking_news_gcm_app_handler.cc | 9 +-
.../breaking_news/breaking_news_gcm_app_handler.h | 3 +-
.../breaking_news_gcm_app_handler_unittest.cc | 68 +++
.../breaking_news/breaking_news_listener.h | 2 +
.../remote/remote_suggestions_provider_impl.cc | 20 +-
.../remote_suggestions_provider_impl_unittest.cc | 603 ++++++++++++++++-----
6 files changed, 542 insertions(+), 163 deletions(-)

Upstream: git.chromium.org


  • Share