Chromium Code Reviews| 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 <memory> | 10 #include <memory> |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 90 // Returns the last status message from the snippets fetcher. | 90 // Returns the last status message from the snippets fetcher. |
| 91 const std::string& last_status() const { | 91 const std::string& last_status() const { |
| 92 return snippets_fetcher_->last_status(); | 92 return snippets_fetcher_->last_status(); |
| 93 } | 93 } |
| 94 | 94 |
| 95 // Returns the last json from the snippets fetcher. | 95 // Returns the last json from the snippets fetcher. |
| 96 const std::string& last_json() const { | 96 const std::string& last_json() const { |
| 97 return snippets_fetcher_->last_json(); | 97 return snippets_fetcher_->last_json(); |
| 98 } | 98 } |
| 99 | 99 |
| 100 // Does the fetcher use authentication to get personalized results? | |
| 101 bool UseAuthentication() const { | |
| 102 return snippets_fetcher_->UseAuthentication(); | |
|
Bernhard Bauer
2016/05/18 10:08:04
I think at this point it might be easier to just r
jkrcal
2016/05/19 07:30:28
Done.
| |
| 103 } | |
| 104 | |
| 105 // Does the fetcher use host restriction? | |
| 106 bool UseHostRestriction() const { | |
| 107 return snippets_fetcher_->UseHostRestriction(); | |
| 108 } | |
| 109 | |
| 110 // Does the fetcher use host restriction? | |
| 111 NTPSnippetsFetcher::Personalization personalization() const { | |
| 112 return snippets_fetcher_->personalization(); | |
| 113 } | |
| 114 | |
| 100 // (Re)schedules the periodic fetching of snippets. This is necessary because | 115 // (Re)schedules the periodic fetching of snippets. This is necessary because |
| 101 // the schedule depends on the time of day. | 116 // the schedule depends on the time of day. |
| 102 void RescheduleFetching(); | 117 void RescheduleFetching(); |
| 103 | 118 |
| 104 // Fetches the image for the snippet with the given |snippet_id| and runs the | 119 // Fetches the image for the snippet with the given |snippet_id| and runs the |
| 105 // |callback|. If that snippet doesn't exist or the fetch fails, the callback | 120 // |callback|. If that snippet doesn't exist or the fetch fails, the callback |
| 106 // gets a null image. | 121 // gets a null image. |
| 107 void FetchSnippetImage(const std::string& snippet_id, | 122 void FetchSnippetImage(const std::string& snippet_id, |
| 108 const ImageFetchedCallback& callback); | 123 const ImageFetchedCallback& callback); |
| 109 | 124 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 199 // Sent when the service is shutting down. | 214 // Sent when the service is shutting down. |
| 200 virtual void NTPSnippetsServiceShutdown() = 0; | 215 virtual void NTPSnippetsServiceShutdown() = 0; |
| 201 | 216 |
| 202 protected: | 217 protected: |
| 203 virtual ~NTPSnippetsServiceObserver() {} | 218 virtual ~NTPSnippetsServiceObserver() {} |
| 204 }; | 219 }; |
| 205 | 220 |
| 206 } // namespace ntp_snippets | 221 } // namespace ntp_snippets |
| 207 | 222 |
| 208 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ | 223 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ |
| OLD | NEW |