| 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 <set> | 10 #include <set> |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 // The snippets fetcher. | 165 // The snippets fetcher. |
| 166 scoped_ptr<NTPSnippetsFetcher> snippets_fetcher_; | 166 scoped_ptr<NTPSnippetsFetcher> snippets_fetcher_; |
| 167 | 167 |
| 168 // The subscription to the snippets fetcher. | 168 // The subscription to the snippets fetcher. |
| 169 scoped_ptr<NTPSnippetsFetcher::SnippetsAvailableCallbackList::Subscription> | 169 scoped_ptr<NTPSnippetsFetcher::SnippetsAvailableCallbackList::Subscription> |
| 170 snippets_fetcher_subscription_; | 170 snippets_fetcher_subscription_; |
| 171 | 171 |
| 172 // Timer that calls us back when the next snippet expires. | 172 // Timer that calls us back when the next snippet expires. |
| 173 base::OneShotTimer expiry_timer_; | 173 base::OneShotTimer expiry_timer_; |
| 174 | 174 |
| 175 const ParseJSONCallback parse_json_callback_; | 175 ParseJSONCallback parse_json_callback_; |
| 176 | 176 |
| 177 base::WeakPtrFactory<NTPSnippetsService> weak_ptr_factory_; | 177 base::WeakPtrFactory<NTPSnippetsService> weak_ptr_factory_; |
| 178 | 178 |
| 179 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsService); | 179 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsService); |
| 180 }; | 180 }; |
| 181 | 181 |
| 182 class NTPSnippetsServiceObserver { | 182 class NTPSnippetsServiceObserver { |
| 183 public: | 183 public: |
| 184 // Sent every time the service loads a new set of data. | 184 // Sent every time the service loads a new set of data. |
| 185 virtual void NTPSnippetsServiceLoaded() = 0; | 185 virtual void NTPSnippetsServiceLoaded() = 0; |
| 186 // Sent when the service is shutting down. | 186 // Sent when the service is shutting down. |
| 187 virtual void NTPSnippetsServiceShutdown() = 0; | 187 virtual void NTPSnippetsServiceShutdown() = 0; |
| 188 | 188 |
| 189 protected: | 189 protected: |
| 190 virtual ~NTPSnippetsServiceObserver() {} | 190 virtual ~NTPSnippetsServiceObserver() {} |
| 191 }; | 191 }; |
| 192 | 192 |
| 193 } // namespace ntp_snippets | 193 } // namespace ntp_snippets |
| 194 | 194 |
| 195 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ | 195 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ |
| OLD | NEW |