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

Side by Side Diff: components/ntp_snippets/remote/remote_suggestions_fetcher.h

Issue 2686063003: [remote suggestions] Attach the fetch time to RemoteSnippets, ContentSnippets and SnippetArticle (Closed)
Patch Set: Update comments Created 3 years, 10 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
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_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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 SnippetsAvailableCallback callback, 151 SnippetsAvailableCallback callback,
152 std::unique_ptr<base::Value> result, 152 std::unique_ptr<base::Value> result,
153 internal::FetchResult status_code, 153 internal::FetchResult status_code,
154 const std::string& error_details); 154 const std::string& error_details);
155 void FetchFinished(OptionalFetchedCategories categories, 155 void FetchFinished(OptionalFetchedCategories categories,
156 SnippetsAvailableCallback callback, 156 SnippetsAvailableCallback callback,
157 internal::FetchResult status_code, 157 internal::FetchResult status_code,
158 const std::string& error_details); 158 const std::string& error_details);
159 159
160 bool JsonToSnippets(const base::Value& parsed, 160 bool JsonToSnippets(const base::Value& parsed,
161 FetchedCategoriesVector* categories); 161 FetchedCategoriesVector* categories,
162 const base::Time& fetch_time);
162 163
163 bool DemandQuotaForRequest(bool interactive_request); 164 bool DemandQuotaForRequest(bool interactive_request);
164 165
165 // Authentication for signed-in users. 166 // Authentication for signed-in users.
166 SigninManagerBase* signin_manager_; 167 SigninManagerBase* signin_manager_;
167 OAuth2TokenService* token_service_; 168 OAuth2TokenService* token_service_;
168 std::unique_ptr<OAuth2TokenService::Request> oauth_request_; 169 std::unique_ptr<OAuth2TokenService::Request> oauth_request_;
169 bool waiting_for_refresh_token_ = false; 170 bool waiting_for_refresh_token_ = false;
170 171
171 // When a token request gets canceled, we want to retry once. 172 // When a token request gets canceled, we want to retry once.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 std::string last_fetch_json_; 209 std::string last_fetch_json_;
209 210
210 base::WeakPtrFactory<RemoteSuggestionsFetcher> weak_ptr_factory_; 211 base::WeakPtrFactory<RemoteSuggestionsFetcher> weak_ptr_factory_;
211 212
212 DISALLOW_COPY_AND_ASSIGN(RemoteSuggestionsFetcher); 213 DISALLOW_COPY_AND_ASSIGN(RemoteSuggestionsFetcher);
213 }; 214 };
214 215
215 } // namespace ntp_snippets 216 } // namespace ntp_snippets
216 217
217 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_FETCHER_H_ 218 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_FETCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698