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

Unified Diff: components/ntp_snippets/remote/ntp_snippets_fetcher.h

Issue 2395123002: Connecting UserClassifier to NtpSnippetsFetcher (Closed)
Patch Set: A small fix Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: components/ntp_snippets/remote/ntp_snippets_fetcher.h
diff --git a/components/ntp_snippets/remote/ntp_snippets_fetcher.h b/components/ntp_snippets/remote/ntp_snippets_fetcher.h
index 2d801ac25b858ac06204bfdd88b74fcdd02a8a5e..d2d35c42abf43307b65d99c338798c18ed086c53 100644
--- a/components/ntp_snippets/remote/ntp_snippets_fetcher.h
+++ b/components/ntp_snippets/remote/ntp_snippets_fetcher.h
@@ -18,6 +18,7 @@
#include "base/time/time.h"
#include "components/ntp_snippets/remote/ntp_snippet.h"
#include "components/ntp_snippets/remote/request_throttler.h"
+#include "components/ntp_snippets/user_classifier.h"
Marc Treib 2016/10/06 13:41:55 Not needed I think, the forward decl below should
jkrcal 2016/10/06 14:45:58 Done.
#include "google_apis/gaia/oauth2_token_service.h"
#include "net/url_request/url_fetcher_delegate.h"
#include "net/url_request/url_request_context_getter.h"
@@ -31,6 +32,8 @@ class Value;
namespace ntp_snippets {
+class UserClassifier;
+
// Fetches snippet data for the NTP from the server.
class NTPSnippetsFetcher : public OAuth2TokenService::Consumer,
public OAuth2TokenService::Observer,
@@ -92,7 +95,8 @@ class NTPSnippetsFetcher : public OAuth2TokenService::Consumer,
PrefService* pref_service,
CategoryFactory* category_factory,
const ParseJSONCallback& parse_json_callback,
- const std::string& api_key);
+ const std::string& api_key,
+ const UserClassifier* user_classifier);
~NTPSnippetsFetcher() override;
// Set a callback that is called when a new set of snippets are downloaded,
@@ -165,6 +169,7 @@ class NTPSnippetsFetcher : public OAuth2TokenService::Consumer,
std::set<std::string> excluded_ids;
int count_to_fetch;
bool interactive_request;
+ std::string user_class;
RequestParams();
~RequestParams();
@@ -253,6 +258,9 @@ class NTPSnippetsFetcher : public OAuth2TokenService::Consumer,
// Allow for an injectable tick clock for testing.
std::unique_ptr<base::TickClock> tick_clock_;
+ // Classifier that tells us how active the user is. Not owned.
+ const UserClassifier* user_classifier_;
+
// Request throttler for limiting requests.
RequestThrottler request_throttler_;

Powered by Google App Engine
This is Rietveld 408576698