| 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_REMOTE_REMOTE_SUGGESTIONS_FETCHER_H_ | 5 #ifndef COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_FETCHER_H_ |
| 6 #define COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_FETCHER_H_ | 6 #define COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_FETCHER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 std::pair<internal::JsonRequest::Builder, SnippetsAvailableCallback>> | 183 std::pair<internal::JsonRequest::Builder, SnippetsAvailableCallback>> |
| 184 pending_requests_; | 184 pending_requests_; |
| 185 | 185 |
| 186 // Weak reference, not owned. | 186 // Weak reference, not owned. |
| 187 translate::LanguageModel* const language_model_; | 187 translate::LanguageModel* const language_model_; |
| 188 | 188 |
| 189 const ParseJSONCallback parse_json_callback_; | 189 const ParseJSONCallback parse_json_callback_; |
| 190 | 190 |
| 191 // API endpoint for fetching suggestions. | 191 // API endpoint for fetching suggestions. |
| 192 const GURL fetch_url_; | 192 const GURL fetch_url_; |
| 193 // Which API to use | |
| 194 const internal::FetchAPI fetch_api_; | |
| 195 | 193 |
| 196 // API key to use for non-authenticated requests. | 194 // API key to use for non-authenticated requests. |
| 197 const std::string api_key_; | 195 const std::string api_key_; |
| 198 | 196 |
| 199 // Allow for an injectable clock for testing. | 197 // Allow for an injectable clock for testing. |
| 200 std::unique_ptr<base::Clock> clock_; | 198 std::unique_ptr<base::Clock> clock_; |
| 201 | 199 |
| 202 // Classifier that tells us how active the user is. Not owned. | 200 // Classifier that tells us how active the user is. Not owned. |
| 203 const UserClassifier* user_classifier_; | 201 const UserClassifier* user_classifier_; |
| 204 | 202 |
| 205 // Info on the last finished fetch. | 203 // Info on the last finished fetch. |
| 206 std::string last_status_; | 204 std::string last_status_; |
| 207 std::string last_fetch_json_; | 205 std::string last_fetch_json_; |
| 208 | 206 |
| 209 DISALLOW_COPY_AND_ASSIGN(RemoteSuggestionsFetcher); | 207 DISALLOW_COPY_AND_ASSIGN(RemoteSuggestionsFetcher); |
| 210 }; | 208 }; |
| 211 | 209 |
| 212 } // namespace ntp_snippets | 210 } // namespace ntp_snippets |
| 213 | 211 |
| 214 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_FETCHER_H_ | 212 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_FETCHER_H_ |
| OLD | NEW |