Chromium Code Reviews| 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 a9fc454a1da560eebd56d3ab062894bdacfd1baa..04b522b337fb45c77aa84c35a3fe2aecadb394b0 100644 |
| --- a/components/ntp_snippets/content_suggestions_service.h |
| +++ b/components/ntp_snippets/content_suggestions_service.h |
| @@ -15,6 +15,7 @@ |
| #include "base/observer_list.h" |
| #include "base/optional.h" |
| #include "base/scoped_observer.h" |
| +#include "base/task/cancelable_task_tracker.h" |
| #include "base/time/time.h" |
| #include "components/history/core/browser/history_service.h" |
| #include "components/history/core/browser/history_service_observer.h" |
| @@ -31,6 +32,14 @@ |
| class PrefService; |
| class PrefRegistrySimple; |
| +namespace favicon { |
| +class LargeIconService; |
| +} // namespace favicon |
| + |
| +namespace favicon_base { |
| +struct LargeIconImageResult; |
| +} // namespace favicon_base |
| + |
| namespace ntp_snippets { |
| class RemoteSuggestionsProvider; |
| @@ -90,6 +99,8 @@ class ContentSuggestionsService : public KeyedService, |
| State state, |
| SigninManagerBase* signin_manager, // Can be nullptr in unittests. |
| history::HistoryService* history_service, // Can be nullptr in unittests. |
| + favicon::LargeIconService* |
| + large_icon_service, // Can be nullptr in unittests. |
|
Bernhard Bauer
2017/03/31 16:45:16
Nit: I would move the comment to the previous line
jkrcal
2017/04/03 12:37:36
Done.
|
| PrefService* pref_service, |
| std::unique_ptr<CategoryRanker> category_ranker, |
| std::unique_ptr<UserClassifier> user_classifier, |
| @@ -304,6 +315,21 @@ class ContentSuggestionsService : public KeyedService, |
| void RestoreDismissedCategoriesFromPrefs(); |
| void StoreDismissedCategoriesToPrefs(); |
| + // Callbacks for fetching favicons. |
| + void OnGetFaviconFromCacheFinished( |
| + const GURL& publisher_url, |
| + int minimum_size_in_pixel, |
| + int desired_size_in_pixel, |
| + const ImageFetchedCallback& callback, |
| + bool continue_to_google_server, |
| + const favicon_base::LargeIconImageResult& result); |
| + void OnGetFaviconFromGoogleServerFinished( |
| + const GURL& publisher_url, |
| + int minimum_size_in_pixel, |
| + int desired_size_in_pixel, |
| + const ImageFetchedCallback& callback, |
| + bool success); |
| + |
| // Whether the content suggestions feature is enabled. |
| State state_; |
| @@ -349,11 +375,15 @@ class ContentSuggestionsService : public KeyedService, |
| const std::vector<ContentSuggestion> no_suggestions_; |
| + base::CancelableTaskTracker favicons_task_tracker_; |
| + |
| // Keep a direct reference to this special provider to redirect debugging |
| // calls to it. If the RemoteSuggestionsProvider is loaded, it is also present |
| // in |providers_|, otherwise this is a nullptr. |
| RemoteSuggestionsProvider* remote_suggestions_provider_; |
| + favicon::LargeIconService* large_icon_service_; |
| + |
| PrefService* pref_service_; |
| // Interface for informing about external events that have influence on |