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_NTP_SNIPPETS_FETCHER_H_ | 5 #ifndef COMPONENTS_NTP_SNIPPETS_REMOTE_NTP_SNIPPETS_FETCHER_H_ |
6 #define COMPONENTS_NTP_SNIPPETS_REMOTE_NTP_SNIPPETS_FETCHER_H_ | 6 #define COMPONENTS_NTP_SNIPPETS_REMOTE_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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 CHROME_READER_API, | 180 CHROME_READER_API, |
181 CHROME_CONTENT_SUGGESTIONS_API, | 181 CHROME_CONTENT_SUGGESTIONS_API, |
182 }; | 182 }; |
183 | 183 |
184 struct RequestBuilder { | 184 struct RequestBuilder { |
185 Params params; | 185 Params params; |
186 FetchAPI fetch_api = CHROME_READER_API; | 186 FetchAPI fetch_api = CHROME_READER_API; |
187 std::string obfuscated_gaia_id; | 187 std::string obfuscated_gaia_id; |
188 bool only_return_personalized_results = false; | 188 bool only_return_personalized_results = false; |
189 std::string user_class; | 189 std::string user_class; |
190 translate::LanguageModel::LanguageInfo ui_language{"", 0.0f}; | 190 translate::LanguageModel::LanguageInfo ui_language; |
191 translate::LanguageModel::LanguageInfo other_top_language{"", 0.0f}; | 191 translate::LanguageModel::LanguageInfo other_top_language; |
192 | 192 |
193 RequestBuilder(); | 193 RequestBuilder(); |
194 RequestBuilder(RequestBuilder&&); | 194 RequestBuilder(RequestBuilder&&); |
195 ~RequestBuilder(); | 195 ~RequestBuilder(); |
196 | 196 |
197 std::string BuildRequest(); | 197 std::string BuildRequest(); |
198 }; | 198 }; |
199 | 199 |
200 RequestBuilder MakeRequestBuilder() const; | 200 RequestBuilder MakeRequestBuilder() const; |
201 | 201 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 std::string last_status_; | 287 std::string last_status_; |
288 std::string last_fetch_json_; | 288 std::string last_fetch_json_; |
289 | 289 |
290 base::WeakPtrFactory<NTPSnippetsFetcher> weak_ptr_factory_; | 290 base::WeakPtrFactory<NTPSnippetsFetcher> weak_ptr_factory_; |
291 | 291 |
292 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsFetcher); | 292 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsFetcher); |
293 }; | 293 }; |
294 } // namespace ntp_snippets | 294 } // namespace ntp_snippets |
295 | 295 |
296 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_NTP_SNIPPETS_FETCHER_H_ | 296 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_NTP_SNIPPETS_FETCHER_H_ |
OLD | NEW |