OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_FETCHER_H_ | 5 #ifndef COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_FETCHER_H_ |
6 #define COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_FETCHER_H_ | 6 #define COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_FETCHER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 // Enumeration listing all possible variants of dealing with personalization. | 81 // Enumeration listing all possible variants of dealing with personalization. |
82 enum class Personalization { | 82 enum class Personalization { |
83 kPersonal, | 83 kPersonal, |
84 kNonPersonal, | 84 kNonPersonal, |
85 kBoth | 85 kBoth |
86 }; | 86 }; |
87 | 87 |
88 NTPSnippetsFetcher( | 88 NTPSnippetsFetcher( |
89 SigninManagerBase* signin_manager, | 89 SigninManagerBase* signin_manager, |
90 OAuth2TokenService* oauth2_token_service, | 90 OAuth2TokenService* token_service, |
91 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter, | 91 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter, |
92 PrefService* pref_service, | 92 PrefService* pref_service, |
93 CategoryFactory* category_factory, | 93 CategoryFactory* category_factory, |
94 const ParseJSONCallback& parse_json_callback, | 94 const ParseJSONCallback& parse_json_callback, |
95 const std::string& api_key); | 95 const std::string& api_key); |
96 ~NTPSnippetsFetcher() override; | 96 ~NTPSnippetsFetcher() override; |
97 | 97 |
98 // Set a callback that is called when a new set of snippets are downloaded, | 98 // Set a callback that is called when a new set of snippets are downloaded, |
99 // overriding any previously set callback. | 99 // overriding any previously set callback. |
100 void SetCallback(const SnippetsAvailableCallback& callback); | 100 void SetCallback(const SnippetsAvailableCallback& callback); |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 // When a token request gets canceled, we want to retry once. | 259 // When a token request gets canceled, we want to retry once. |
260 bool oauth_token_retried_; | 260 bool oauth_token_retried_; |
261 | 261 |
262 base::WeakPtrFactory<NTPSnippetsFetcher> weak_ptr_factory_; | 262 base::WeakPtrFactory<NTPSnippetsFetcher> weak_ptr_factory_; |
263 | 263 |
264 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsFetcher); | 264 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsFetcher); |
265 }; | 265 }; |
266 } // namespace ntp_snippets | 266 } // namespace ntp_snippets |
267 | 267 |
268 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_FETCHER_H_ | 268 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_FETCHER_H_ |
OLD | NEW |