| 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_REMOTE_NTP_SNIPPETS_SERVICE_H_ | 5 #ifndef COMPONENTS_NTP_SNIPPETS_REMOTE_NTP_SNIPPETS_SERVICE_H_ |
| 6 #define COMPONENTS_NTP_SNIPPETS_REMOTE_NTP_SNIPPETS_SERVICE_H_ | 6 #define COMPONENTS_NTP_SNIPPETS_REMOTE_NTP_SNIPPETS_SERVICE_H_ |
| 7 | 7 |
| 8 #include <cstddef> | 8 #include <cstddef> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 const std::string& image_data) override; | 212 const std::string& image_data) override; |
| 213 | 213 |
| 214 // Callbacks for the NTPSnippetsDatabase. | 214 // Callbacks for the NTPSnippetsDatabase. |
| 215 void OnDatabaseLoaded(NTPSnippet::PtrVector snippets); | 215 void OnDatabaseLoaded(NTPSnippet::PtrVector snippets); |
| 216 void OnDatabaseError(); | 216 void OnDatabaseError(); |
| 217 | 217 |
| 218 // Callback for the SuggestionsService. | 218 // Callback for the SuggestionsService. |
| 219 void OnSuggestionsChanged(const suggestions::SuggestionsProfile& suggestions); | 219 void OnSuggestionsChanged(const suggestions::SuggestionsProfile& suggestions); |
| 220 | 220 |
| 221 // Callback for the NTPSnippetsFetcher. | 221 // Callback for the NTPSnippetsFetcher. |
| 222 void OnFetchFinished(NTPSnippetsFetcher::OptionalSnippets snippets); | 222 void OnFetchFinished( |
| 223 NTPSnippetsFetcher::OptionalFetchedCategories fetched_categories); |
| 223 | 224 |
| 224 // Moves all snippets from |to_archive| into the archive of the |category|. | 225 // Moves all snippets from |to_archive| into the archive of the |category|. |
| 225 // It also deletes the snippets from the DB and keeps the archive reasonably | 226 // It also deletes the snippets from the DB and keeps the archive reasonably |
| 226 // short. | 227 // short. |
| 227 void ArchiveSnippets(Category category, NTPSnippet::PtrVector* to_archive); | 228 void ArchiveSnippets(Category category, NTPSnippet::PtrVector* to_archive); |
| 228 | 229 |
| 229 // Replace old snippets in |category| by newly available snippets. | 230 // Replace old snippets in |category| by newly available snippets. |
| 230 void ReplaceSnippets(Category category, NTPSnippet::PtrVector new_snippets); | 231 void ReplaceSnippets(Category category, NTPSnippet::PtrVector new_snippets); |
| 231 | 232 |
| 232 std::set<std::string> GetSnippetHostsFromPrefs() const; | 233 std::set<std::string> GetSnippetHostsFromPrefs() const; |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 | 378 |
| 378 // Request throttler for limiting requests to thumbnail images. | 379 // Request throttler for limiting requests to thumbnail images. |
| 379 RequestThrottler thumbnail_requests_throttler_; | 380 RequestThrottler thumbnail_requests_throttler_; |
| 380 | 381 |
| 381 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsService); | 382 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsService); |
| 382 }; | 383 }; |
| 383 | 384 |
| 384 } // namespace ntp_snippets | 385 } // namespace ntp_snippets |
| 385 | 386 |
| 386 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_NTP_SNIPPETS_SERVICE_H_ | 387 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_NTP_SNIPPETS_SERVICE_H_ |
| OLD | NEW |