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

Issue 2244793002: Remove deleted offline page suggestions from opened NTPs (Closed)

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

Description

Remove deleted offline page suggestions from opened NTPs Add OnSuggestionInvalidated methods to the ContentSuggestionsProvider, the ContentSuggestionsService and its observer and to the SnippetsBridge. Remove suggestions from the UI immediately when they're invalidated. Invalidate offline page suggestions when the referenced offline page is deleted, and also clear it from the dismissed_ids list. Add new unit tests for the UI layer and the service layer. BUG=628198 Committed: https://crrev.com/2a48f8508b52e518696495338ea4ed7f9b7e6060 Cr-Commit-Position: refs/heads/master@{#412813}

Patch Set 1 #

Total comments: 17

Patch Set 2 : Rebase #

Patch Set 3 : Michael's and Marc's comments #

Total comments: 4

Patch Set 4 : Rebase (should be no change) #

Patch Set 5 : Marc's comments #

Patch Set 6 : Document that OnSuggestionInvalidated can be fired for non-existing suggestions #

Patch Set 7 : Rebase #

Patch Set 8 : Adjust MockContentSuggestionsProvider #

Unified diffs Side-by-side diffs Delta from patch set Stats (+229 lines, -27 lines) Patch
M chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java View 1 2 2 chunks +8 lines, -1 line 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java View 1 2 1 chunk +10 lines, -1 line 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsBridge.java View 1 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SuggestionsSource.java View 1 2 3 4 5 1 chunk +9 lines, -2 lines 0 comments Download
M chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapterTest.java View 1 2 3 4 5 6 3 chunks +30 lines, -0 lines 0 comments Download
M chrome/browser/android/ntp/ntp_snippets_bridge.h View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/android/ntp/ntp_snippets_bridge.cc View 1 2 3 4 5 6 1 chunk +12 lines, -0 lines 0 comments Download
M chrome/browser/ui/webui/snippets_internals_message_handler.h View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/ui/webui/snippets_internals_message_handler.cc View 1 2 3 4 5 6 1 chunk +8 lines, -0 lines 0 comments Download
M components/ntp_snippets/category_factory.h View 1 chunk +1 line, -1 line 0 comments Download
M components/ntp_snippets/content_suggestions_provider.h View 1 2 3 4 5 1 chunk +13 lines, -0 lines 0 comments Download
M components/ntp_snippets/content_suggestions_service.h View 1 2 3 4 5 3 chunks +19 lines, -0 lines 0 comments Download
M components/ntp_snippets/content_suggestions_service.cc View 1 2 3 4 5 3 chunks +30 lines, -13 lines 0 comments Download
M components/ntp_snippets/content_suggestions_service_unittest.cc View 1 2 3 4 5 6 chunks +43 lines, -8 lines 0 comments Download
M components/ntp_snippets/mock_content_suggestions_provider_observer.h View 1 2 3 4 5 6 7 1 chunk +4 lines, -0 lines 0 comments Download
M components/ntp_snippets/offline_pages/offline_page_suggestions_provider.cc View 1 2 3 4 2 chunks +33 lines, -1 line 0 comments Download

Messages

Total messages: 31 (16 generated)
Philipp Keck
PTAL
4 years, 4 months ago (2016-08-12 18:12:35 UTC) #2
Michael van Ouwerkerk
Some drive-by nits :-) (I'm not adding myself to the reviewer list) https://codereview.chromium.org/2244793002/diff/1/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java File chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java ...
4 years, 4 months ago (2016-08-15 11:06:09 UTC) #4
Marc Treib
https://codereview.chromium.org/2244793002/diff/1/components/ntp_snippets/content_suggestions_service.cc File components/ntp_snippets/content_suggestions_service.cc (right): https://codereview.chromium.org/2244793002/diff/1/components/ntp_snippets/content_suggestions_service.cc#newcode226 components/ntp_snippets/content_suggestions_service.cc:226: FOR_EACH_OBSERVER(Observer, observers_, Wouldn't we want to send the invalidation ...
4 years, 4 months ago (2016-08-16 09:03:54 UTC) #11
Philipp Keck
Thank you Michael and Marc. Bernhard, PTAL at the Android part. https://codereview.chromium.org/2244793002/diff/1/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java File chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java (right): ...
4 years, 4 months ago (2016-08-16 10:54:40 UTC) #13
Philipp Keck
https://codereview.chromium.org/2244793002/diff/1/components/ntp_snippets/offline_pages/offline_page_suggestions_provider.cc File components/ntp_snippets/offline_pages/offline_page_suggestions_provider.cc (right): https://codereview.chromium.org/2244793002/diff/1/components/ntp_snippets/offline_pages/offline_page_suggestions_provider.cc#newcode225 components/ntp_snippets/offline_pages/offline_page_suggestions_provider.cc:225: observer()->OnSuggestionInvalidated( On 2016/08/16 10:54:40, Philipp Keck wrote: > On ...
4 years, 4 months ago (2016-08-16 11:21:18 UTC) #14
Michael van Ouwerkerk
java lgtm
4 years, 4 months ago (2016-08-16 11:23:55 UTC) #15
Marc Treib
lgtm C++ LGTM (normally I might have asked for TODOs, but since the next CL ...
4 years, 4 months ago (2016-08-16 11:40:10 UTC) #16
Philipp Keck
https://codereview.chromium.org/2244793002/diff/1/components/ntp_snippets/offline_pages/offline_page_suggestions_provider.cc File components/ntp_snippets/offline_pages/offline_page_suggestions_provider.cc (right): https://codereview.chromium.org/2244793002/diff/1/components/ntp_snippets/offline_pages/offline_page_suggestions_provider.cc#newcode225 components/ntp_snippets/offline_pages/offline_page_suggestions_provider.cc:225: observer()->OnSuggestionInvalidated( On 2016/08/16 11:40:09, Marc Treib wrote: > On ...
4 years, 4 months ago (2016-08-16 11:51:04 UTC) #17
Bernhard Bauer
lgtm
4 years, 4 months ago (2016-08-16 16:55:22 UTC) #18
Philipp Keck
On 2016/08/16 16:55:22, Bernhard Bauer wrote: > lgtm As suggested by bauerb@ over there, I'm ...
4 years, 4 months ago (2016-08-16 17:00:41 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/2244793002/120001
4 years, 4 months ago (2016-08-18 08:14:43 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/54119)
4 years, 4 months ago (2016-08-18 08:23:28 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/2244793002/140001
4 years, 4 months ago (2016-08-18 12:57:56 UTC) #27
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 4 months ago (2016-08-18 13:34:08 UTC) #29
commit-bot: I haz the power
4 years, 4 months ago (2016-08-18 13:36:00 UTC) #31
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/2a48f8508b52e518696495338ea4ed7f9b7e6060
Cr-Commit-Position: refs/heads/master@{#412813}

Powered by Google App Engine
This is Rietveld 408576698