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

Unified Diff: components/ntp_snippets/ntp_snippets_service.h

Issue 2292003002: Move OnURLsDeleted from NTPSnippetsService to ContentSuggestionsService (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/ntp_snippets_service.h
diff --git a/components/ntp_snippets/ntp_snippets_service.h b/components/ntp_snippets/ntp_snippets_service.h
index fce675592f628e8aa5f41a6d33c013af5a7bbc83..7e5738fd4d9ded0a794fba6d0ad890ace883fc05 100644
--- a/components/ntp_snippets/ntp_snippets_service.h
+++ b/components/ntp_snippets/ntp_snippets_service.h
@@ -17,7 +17,6 @@
#include "base/macros.h"
#include "base/scoped_observer.h"
#include "base/timer/timer.h"
-#include "components/history/core/browser/history_service_observer.h"
#include "components/image_fetcher/image_fetcher_delegate.h"
#include "components/ntp_snippets/category.h"
#include "components/ntp_snippets/category_factory.h"
@@ -74,8 +73,7 @@ class NTPSnippetsServiceObserver;
// a CachedImageFetcher class that handles the caching aspects and looks like an
// image fetcher to the NTPSnippetService.
class NTPSnippetsService : public ContentSuggestionsProvider,
- public image_fetcher::ImageFetcherDelegate,
- public history::HistoryServiceObserver {
+ public image_fetcher::ImageFetcherDelegate {
public:
// |application_language_code| should be a ISO 639-1 compliant string, e.g.
// 'en' or 'en-US'. Note that this code should only specify the language, not
@@ -84,7 +82,6 @@ class NTPSnippetsService : public ContentSuggestionsProvider,
NTPSnippetsService(Observer* observer,
CategoryFactory* category_factory,
PrefService* pref_service,
- history::HistoryService* history_service,
suggestions::SuggestionsService* suggestions_service,
const std::string& application_language_code,
NTPSnippetsScheduler* scheduler,
@@ -140,6 +137,8 @@ class NTPSnippetsService : public ContentSuggestionsProvider,
void DismissSuggestion(const std::string& suggestion_id) override;
void FetchSuggestionImage(const std::string& suggestion_id,
const ImageFetchedCallback& callback) override;
+ void RemoveURLsFromHistory(bool all_history,
+ const std::vector<GURL>& deleted_urls) override;
void ClearHistory(
base::Time begin,
base::Time end,
@@ -207,15 +206,6 @@ class NTPSnippetsService : public ContentSuggestionsProvider,
ERROR_OCCURRED
};
- // history::HistoryServiceObserver implementation.
- void OnURLsDeleted(history::HistoryService* history_service,
- bool all_history,
- bool expired,
- const history::URLRows& deleted_rows,
- const std::set<GURL>& favicon_urls) override;
- void HistoryServiceBeingDeleted(
- history::HistoryService* history_service) override;
-
// image_fetcher::ImageFetcherDelegate implementation.
void OnImageDataFetched(const std::string& snippet_id,
const std::string& image_data) override;
@@ -312,11 +302,6 @@ class NTPSnippetsService : public ContentSuggestionsProvider,
// Scheduler for fetching snippets. Not owned.
NTPSnippetsScheduler* scheduler_;
- // Observer for the HistoryService. We clear all cached suggestions when
- // history gets deleted.
- ScopedObserver<history::HistoryService, history::HistoryServiceObserver>
- history_service_observer_;
-
// The subscription to the SuggestionsService. When the suggestions change,
// SuggestionsService will call |OnSuggestionsChanged|, which triggers an
// update to the set of snippets.

Powered by Google App Engine
This is Rietveld 408576698