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

Unified Diff: components/ntp_snippets/content_suggestions_service.h

Issue 2377663002: [NTP Snippets] Introduce ContentSuggestion::ID (Closed)
Patch Set: . Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/ntp_snippets/content_suggestions_service.h
diff --git a/components/ntp_snippets/content_suggestions_service.h b/components/ntp_snippets/content_suggestions_service.h
index a038fbfe830127433d161baf47b659f18e3f064e..036c0c8df4a1714c09b60d32735d9f04828d85f4 100644
--- a/components/ntp_snippets/content_suggestions_service.h
+++ b/components/ntp_snippets/content_suggestions_service.h
@@ -63,12 +63,12 @@ class ContentSuggestionsService : public KeyedService,
// Fired when a suggestion has been invalidated. The UI must immediately
// clear the suggestion even from open NTPs. Invalidation happens, for
// example, when the content that the suggestion refers to is gone.
- // Note that this event may be fired even if the corresponding |category| is
+ // Note that this event may be fired even if the corresponding category is
// not currently AVAILABLE, because open UIs may still be showing the
// suggestion that is to be removed. This event may also be fired for
// |suggestion_id|s that never existed and should be ignored in that case.
- virtual void OnSuggestionInvalidated(Category category,
- const std::string& suggestion_id) = 0;
+ virtual void OnSuggestionInvalidated(
+ const ContentSuggestion::ID& suggestion_id) = 0;
// Sent when the service is shutting down. After the service has shut down,
// it will not provide any data anymore, though calling the getters is still
@@ -114,12 +114,12 @@ class ContentSuggestionsService : public KeyedService,
// runs the |callback|. If that suggestion doesn't exist or the fetch fails,
// the callback gets an empty image. The callback will not be called
// synchronously.
- void FetchSuggestionImage(const std::string& suggestion_id,
+ void FetchSuggestionImage(const ContentSuggestion::ID& suggestion_id,
const ImageFetchedCallback& callback);
// Dismisses the suggestion with the given |suggestion_id|, if it exists.
// This will not trigger an update through the observers.
- void DismissSuggestion(const std::string& suggestion_id);
+ void DismissSuggestion(const ContentSuggestion::ID& suggestion_id);
// Dismisses the given |category|, if it exists.
// This will not trigger an update through the observers.
@@ -193,9 +193,9 @@ class ContentSuggestionsService : public KeyedService,
void OnCategoryStatusChanged(ContentSuggestionsProvider* provider,
Category category,
CategoryStatus new_status) override;
- void OnSuggestionInvalidated(ContentSuggestionsProvider* provider,
- Category category,
- const std::string& suggestion_id) override;
+ void OnSuggestionInvalidated(
+ ContentSuggestionsProvider* provider,
+ const ContentSuggestion::ID& suggestion_id) override;
// history::HistoryServiceObserver implementation.
void OnURLsDeleted(history::HistoryService* history_service,
@@ -214,8 +214,7 @@ class ContentSuggestionsService : public KeyedService,
// Removes a suggestion from the local store |suggestions_by_category_|, if it
// exists. Returns true if a suggestion was removed.
- bool RemoveSuggestionByID(Category category,
- const std::string& suggestion_id);
+ bool RemoveSuggestionByID(const ContentSuggestion::ID& suggestion_id);
// Fires the OnCategoryStatusChanged event for the given |category|.
void NotifyCategoryStatusChanged(Category category);

Powered by Google App Engine
This is Rietveld 408576698