| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ | 5 #ifndef COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ |
| 6 #define COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ | 6 #define COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 // suggestions from the suggestion service) and adds them to the current ones. | 101 // suggestions from the suggestion service) and adds them to the current ones. |
| 102 // Only called from chrome://snippets-internals, DO NOT USE otherwise! | 102 // Only called from chrome://snippets-internals, DO NOT USE otherwise! |
| 103 // Ignored while ready() is false. | 103 // Ignored while ready() is false. |
| 104 void FetchSnippetsFromHosts(const std::set<std::string>& hosts, | 104 void FetchSnippetsFromHosts(const std::set<std::string>& hosts, |
| 105 bool interactive_request); | 105 bool interactive_request); |
| 106 | 106 |
| 107 const NTPSnippetsFetcher* snippets_fetcher() const { | 107 const NTPSnippetsFetcher* snippets_fetcher() const { |
| 108 return snippets_fetcher_.get(); | 108 return snippets_fetcher_.get(); |
| 109 } | 109 } |
| 110 | 110 |
| 111 // (Re)schedules the periodic fetching of snippets. | 111 // (Re)schedules the periodic fetching of snippets. If |force| is true, the |
| 112 void RescheduleFetching(); | 112 // tasks will be re-scheduled even if they already exist and have the correct |
| 113 // periods. |
| 114 void RescheduleFetching(bool force); |
| 113 | 115 |
| 114 // ContentSuggestionsProvider implementation | 116 // ContentSuggestionsProvider implementation |
| 115 CategoryStatus GetCategoryStatus(Category category) override; | 117 CategoryStatus GetCategoryStatus(Category category) override; |
| 116 CategoryInfo GetCategoryInfo(Category category) override; | 118 CategoryInfo GetCategoryInfo(Category category) override; |
| 117 void DismissSuggestion(const std::string& suggestion_id) override; | 119 void DismissSuggestion(const std::string& suggestion_id) override; |
| 118 void FetchSuggestionImage(const std::string& suggestion_id, | 120 void FetchSuggestionImage(const std::string& suggestion_id, |
| 119 const ImageFetchedCallback& callback) override; | 121 const ImageFetchedCallback& callback) override; |
| 120 void ClearHistory( | 122 void ClearHistory( |
| 121 base::Time begin, | 123 base::Time begin, |
| 122 base::Time end, | 124 base::Time end, |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 | 361 |
| 360 // Request throttler for limiting requests to thumbnail images. | 362 // Request throttler for limiting requests to thumbnail images. |
| 361 RequestThrottler thumbnail_requests_throttler_; | 363 RequestThrottler thumbnail_requests_throttler_; |
| 362 | 364 |
| 363 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsService); | 365 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsService); |
| 364 }; | 366 }; |
| 365 | 367 |
| 366 } // namespace ntp_snippets | 368 } // namespace ntp_snippets |
| 367 | 369 |
| 368 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ | 370 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ |
| OLD | NEW |