| 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 // and the service can't be used anymore. | 193 // and the service can't be used anymore. |
| 194 ERROR_OCCURRED | 194 ERROR_OCCURRED |
| 195 }; | 195 }; |
| 196 | 196 |
| 197 // Returns the URL of the image of a snippet if it is among the current or | 197 // Returns the URL of the image of a snippet if it is among the current or |
| 198 // among the archived snippets in |category|. Returns an empty URL, otherwise. | 198 // among the archived snippets in |category|. Returns an empty URL, otherwise. |
| 199 GURL FindSnippetImageUrl(Category category, | 199 GURL FindSnippetImageUrl(Category category, |
| 200 const std::string& snippet_id) const; | 200 const std::string& snippet_id) const; |
| 201 | 201 |
| 202 // image_fetcher::ImageFetcherDelegate implementation. | 202 // image_fetcher::ImageFetcherDelegate implementation. |
| 203 void OnImageDataFetched(const std::string& snippet_id, | 203 void OnImageDataFetched(const std::string& suggestion_id, |
| 204 const std::string& image_data) override; | 204 const std::string& image_data) override; |
| 205 | 205 |
| 206 // Callbacks for the NTPSnippetsDatabase. | 206 // Callbacks for the NTPSnippetsDatabase. |
| 207 void OnDatabaseLoaded(NTPSnippet::PtrVector snippets); | 207 void OnDatabaseLoaded(NTPSnippet::PtrVector snippets); |
| 208 void OnDatabaseError(); | 208 void OnDatabaseError(); |
| 209 | 209 |
| 210 // Callback for the SuggestionsService. | 210 // Callback for the SuggestionsService. |
| 211 void OnSuggestionsChanged(const suggestions::SuggestionsProfile& suggestions); | 211 void OnSuggestionsChanged(const suggestions::SuggestionsProfile& suggestions); |
| 212 | 212 |
| 213 // Callback for the NTPSnippetsFetcher. | 213 // Callback for the NTPSnippetsFetcher. |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 | 359 |
| 360 // Request throttler for limiting requests to thumbnail images. | 360 // Request throttler for limiting requests to thumbnail images. |
| 361 RequestThrottler thumbnail_requests_throttler_; | 361 RequestThrottler thumbnail_requests_throttler_; |
| 362 | 362 |
| 363 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsService); | 363 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsService); |
| 364 }; | 364 }; |
| 365 | 365 |
| 366 } // namespace ntp_snippets | 366 } // namespace ntp_snippets |
| 367 | 367 |
| 368 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ | 368 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ |
| OLD | NEW |