Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Side by Side Diff: components/ntp_snippets/ntp_snippets_fetcher.h

Issue 2271283002: Add request type to FetchSuggestionsRequest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/ntp_snippets/ntp_snippets_fetcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 }; 147 };
148 148
149 struct RequestParams { 149 struct RequestParams {
150 FetchAPI fetch_api; 150 FetchAPI fetch_api;
151 std::string obfuscated_gaia_id; 151 std::string obfuscated_gaia_id;
152 bool only_return_personalized_results; 152 bool only_return_personalized_results;
153 std::string user_locale; 153 std::string user_locale;
154 std::set<std::string> host_restricts; 154 std::set<std::string> host_restricts;
155 std::set<std::string> excluded_ids; 155 std::set<std::string> excluded_ids;
156 int count_to_fetch; 156 int count_to_fetch;
157 bool interactive_request;
157 158
158 RequestParams(); 159 RequestParams();
159 ~RequestParams(); 160 ~RequestParams();
160 161
161 std::string BuildRequest(); 162 std::string BuildRequest();
162 }; 163 };
163 164
164 void FetchSnippetsImpl(const GURL& url, 165 void FetchSnippetsImpl(const GURL& url,
165 const std::string& auth_header, 166 const std::string& auth_header,
166 const std::string& request); 167 const std::string& request);
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 SnippetsAvailableCallback snippets_available_callback_; 230 SnippetsAvailableCallback snippets_available_callback_;
230 231
231 // Flag for picking the right (stable/non-stable) API key for Chrome Reader. 232 // Flag for picking the right (stable/non-stable) API key for Chrome Reader.
232 bool is_stable_channel_; 233 bool is_stable_channel_;
233 234
234 // The variant of the fetching to use, loaded from variation parameters. 235 // The variant of the fetching to use, loaded from variation parameters.
235 Personalization personalization_; 236 Personalization personalization_;
236 // Should we apply host restriction? It is loaded from variation parameters. 237 // Should we apply host restriction? It is loaded from variation parameters.
237 bool use_host_restriction_; 238 bool use_host_restriction_;
238 239
240 // Is the request user initiated?
241 bool interactive_request_;
242
239 // Allow for an injectable tick clock for testing. 243 // Allow for an injectable tick clock for testing.
240 std::unique_ptr<base::TickClock> tick_clock_; 244 std::unique_ptr<base::TickClock> tick_clock_;
241 245
242 // Request throttler for limiting requests. 246 // Request throttler for limiting requests.
243 RequestThrottler request_throttler_; 247 RequestThrottler request_throttler_;
244 248
245 // When a token request gets canceled, we want to retry once. 249 // When a token request gets canceled, we want to retry once.
246 bool oauth_token_retried_; 250 bool oauth_token_retried_;
247 251
248 base::WeakPtrFactory<NTPSnippetsFetcher> weak_ptr_factory_; 252 base::WeakPtrFactory<NTPSnippetsFetcher> weak_ptr_factory_;
249 253
250 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsFetcher); 254 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsFetcher);
251 }; 255 };
252 } // namespace ntp_snippets 256 } // namespace ntp_snippets
253 257
254 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_FETCHER_H_ 258 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_FETCHER_H_
OLDNEW
« no previous file with comments | « no previous file | components/ntp_snippets/ntp_snippets_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698