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

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

Issue 2061803002: 📰 The Status card reports disabled sync states (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@simplifyBridge
Patch Set: yolo: another big bag of changes Created 4 years, 5 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 | « components/ntp_snippets/BUILD.gn ('k') | components/ntp_snippets/ntp_snippets_service.h » ('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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 // Does the fetcher use host restrictions? 108 // Does the fetcher use host restrictions?
109 bool UsesHostRestrictions() const; 109 bool UsesHostRestrictions() const;
110 // Does the fetcher use authentication to get personalized results? 110 // Does the fetcher use authentication to get personalized results?
111 bool UsesAuthentication() const; 111 bool UsesAuthentication() const;
112 112
113 // Overrides internal clock for testing purposes. 113 // Overrides internal clock for testing purposes.
114 void SetTickClockForTesting(std::unique_ptr<base::TickClock> tick_clock) { 114 void SetTickClockForTesting(std::unique_ptr<base::TickClock> tick_clock) {
115 tick_clock_ = std::move(tick_clock); 115 tick_clock_ = std::move(tick_clock);
116 } 116 }
117 117
118 void SetPersonalizationForTesting(Personalization personalization) {
119 personalization_ = personalization;
120 }
121
118 private: 122 private:
119 FRIEND_TEST_ALL_PREFIXES(NTPSnippetsFetcherTest, BuildRequestAuthenticated); 123 FRIEND_TEST_ALL_PREFIXES(NTPSnippetsFetcherTest, BuildRequestAuthenticated);
120 FRIEND_TEST_ALL_PREFIXES(NTPSnippetsFetcherTest, BuildRequestUnauthenticated); 124 FRIEND_TEST_ALL_PREFIXES(NTPSnippetsFetcherTest, BuildRequestUnauthenticated);
121 125
122 enum FetchAPI { 126 enum FetchAPI {
123 CHROME_READER_API, 127 CHROME_READER_API,
124 CHROME_CONTENT_SUGGESTIONS_API, 128 CHROME_CONTENT_SUGGESTIONS_API,
125 }; 129 };
126 130
127 struct RequestParams { 131 struct RequestParams {
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 // Allow for an injectable tick clock for testing. 214 // Allow for an injectable tick clock for testing.
211 std::unique_ptr<base::TickClock> tick_clock_; 215 std::unique_ptr<base::TickClock> tick_clock_;
212 216
213 base::WeakPtrFactory<NTPSnippetsFetcher> weak_ptr_factory_; 217 base::WeakPtrFactory<NTPSnippetsFetcher> weak_ptr_factory_;
214 218
215 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsFetcher); 219 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsFetcher);
216 }; 220 };
217 } // namespace ntp_snippets 221 } // namespace ntp_snippets
218 222
219 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_FETCHER_H_ 223 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_FETCHER_H_
OLDNEW
« no previous file with comments | « components/ntp_snippets/BUILD.gn ('k') | components/ntp_snippets/ntp_snippets_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698