| 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 | 199 |
| 200 // image_fetcher::ImageFetcherDelegate implementation. | 200 // image_fetcher::ImageFetcherDelegate implementation. |
| 201 void OnImageDataFetched(const std::string& id_within_category, | 201 void OnImageDataFetched(const std::string& id_within_category, |
| 202 const std::string& image_data) override; | 202 const std::string& image_data) override; |
| 203 | 203 |
| 204 // Callbacks for the NTPSnippetsDatabase. | 204 // Callbacks for the NTPSnippetsDatabase. |
| 205 void OnDatabaseLoaded(NTPSnippet::PtrVector snippets); | 205 void OnDatabaseLoaded(NTPSnippet::PtrVector snippets); |
| 206 void OnDatabaseError(); | 206 void OnDatabaseError(); |
| 207 | 207 |
| 208 // Callback for the NTPSnippetsFetcher. | 208 // Callback for the NTPSnippetsFetcher. |
| 209 void OnFetchFinished(NTPSnippetsFetcher::OptionalSnippets snippets); | 209 void OnFetchFinished( |
| 210 NTPSnippetsFetcher::OptionalFetchedCategories fetched_categories); |
| 210 | 211 |
| 211 // Moves all snippets from |to_archive| into the archive of the |category|. | 212 // Moves all snippets from |to_archive| into the archive of the |category|. |
| 212 // It also deletes the snippets from the DB and keeps the archive reasonably | 213 // It also deletes the snippets from the DB and keeps the archive reasonably |
| 213 // short. | 214 // short. |
| 214 void ArchiveSnippets(Category category, NTPSnippet::PtrVector* to_archive); | 215 void ArchiveSnippets(Category category, NTPSnippet::PtrVector* to_archive); |
| 215 | 216 |
| 216 // Replace old snippets in |category| by newly available snippets. | 217 // Replace old snippets in |category| by newly available snippets. |
| 217 void ReplaceSnippets(Category category, NTPSnippet::PtrVector new_snippets); | 218 void ReplaceSnippets(Category category, NTPSnippet::PtrVector new_snippets); |
| 218 | 219 |
| 219 // Removes expired dismissed snippets from the service and the database. | 220 // Removes expired dismissed snippets from the service and the database. |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 | 353 |
| 353 // Request throttler for limiting requests to thumbnail images. | 354 // Request throttler for limiting requests to thumbnail images. |
| 354 RequestThrottler thumbnail_requests_throttler_; | 355 RequestThrottler thumbnail_requests_throttler_; |
| 355 | 356 |
| 356 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsService); | 357 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsService); |
| 357 }; | 358 }; |
| 358 | 359 |
| 359 } // namespace ntp_snippets | 360 } // namespace ntp_snippets |
| 360 | 361 |
| 361 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_NTP_SNIPPETS_SERVICE_H_ | 362 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_NTP_SNIPPETS_SERVICE_H_ |
| OLD | NEW |