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_REMOTE_SUGGESTIONS_PROVIDER_IMPL_H_ | 5 #ifndef COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_PROVIDER_IMPL_H_ |
6 #define COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_PROVIDER_IMPL_H_ | 6 #define COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_PROVIDER_IMPL_H_ |
7 | 7 |
8 #include <cstddef> | 8 #include <cstddef> |
9 #include <deque> | 9 #include <deque> |
10 #include <map> | 10 #include <map> |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 class PrefRegistrySimple; | 34 class PrefRegistrySimple; |
35 class PrefService; | 35 class PrefService; |
36 | 36 |
37 namespace gfx { | 37 namespace gfx { |
38 class Image; | 38 class Image; |
39 } // namespace gfx | 39 } // namespace gfx |
40 | 40 |
41 namespace image_fetcher { | 41 namespace image_fetcher { |
42 class ImageFetcher; | 42 class ImageFetcher; |
| 43 struct RequestMetadata; |
43 } // namespace image_fetcher | 44 } // namespace image_fetcher |
44 | 45 |
45 namespace ntp_snippets { | 46 namespace ntp_snippets { |
46 | 47 |
47 class CategoryRanker; | 48 class CategoryRanker; |
48 class RemoteSuggestionsDatabase; | 49 class RemoteSuggestionsDatabase; |
49 class RemoteSuggestionsScheduler; | 50 class RemoteSuggestionsScheduler; |
50 | 51 |
51 // CachedImageFetcher takes care of fetching images from the network and caching | 52 // CachedImageFetcher takes care of fetching images from the network and caching |
52 // them in the database. | 53 // them in the database. |
(...skipping 16 matching lines...) Expand all Loading... |
69 const GURL& image_url, | 70 const GURL& image_url, |
70 const ImageFetchedCallback& callback); | 71 const ImageFetchedCallback& callback); |
71 | 72 |
72 private: | 73 private: |
73 // image_fetcher::ImageFetcherDelegate implementation. | 74 // image_fetcher::ImageFetcherDelegate implementation. |
74 void OnImageDataFetched(const std::string& id_within_category, | 75 void OnImageDataFetched(const std::string& id_within_category, |
75 const std::string& image_data) override; | 76 const std::string& image_data) override; |
76 | 77 |
77 void OnImageDecodingDone(const ImageFetchedCallback& callback, | 78 void OnImageDecodingDone(const ImageFetchedCallback& callback, |
78 const std::string& id_within_category, | 79 const std::string& id_within_category, |
79 const gfx::Image& image); | 80 const gfx::Image& image, |
| 81 const image_fetcher::RequestMetadata& metadata); |
80 void OnImageFetchedFromDatabase( | 82 void OnImageFetchedFromDatabase( |
81 const ImageFetchedCallback& callback, | 83 const ImageFetchedCallback& callback, |
82 const ContentSuggestion::ID& suggestion_id, | 84 const ContentSuggestion::ID& suggestion_id, |
83 const GURL& image_url, | 85 const GURL& image_url, |
84 // SnippetImageCallback requires by-value (not const ref). | 86 // SnippetImageCallback requires by-value (not const ref). |
85 std::string data); | 87 std::string data); |
86 void OnImageDecodedFromDatabase(const ImageFetchedCallback& callback, | 88 void OnImageDecodedFromDatabase(const ImageFetchedCallback& callback, |
87 const ContentSuggestion::ID& suggestion_id, | 89 const ContentSuggestion::ID& suggestion_id, |
88 const GURL& url, | 90 const GURL& url, |
89 const gfx::Image& image); | 91 const gfx::Image& image); |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 | 461 |
460 // A clock for getting the time. This allows to inject a clock in tests. | 462 // A clock for getting the time. This allows to inject a clock in tests. |
461 std::unique_ptr<base::Clock> clock_; | 463 std::unique_ptr<base::Clock> clock_; |
462 | 464 |
463 DISALLOW_COPY_AND_ASSIGN(RemoteSuggestionsProviderImpl); | 465 DISALLOW_COPY_AND_ASSIGN(RemoteSuggestionsProviderImpl); |
464 }; | 466 }; |
465 | 467 |
466 } // namespace ntp_snippets | 468 } // namespace ntp_snippets |
467 | 469 |
468 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_PROVIDER_IMPL_H_ | 470 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_PROVIDER_IMPL_H_ |
OLD | NEW |