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

Unified Diff: components/ntp_snippets/ntp_snippets_fetcher.h

Issue 1978513002: Getting the personalization info in chrome://snippets-internals correct. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Polish Created 4 years, 7 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/ntp_snippets_fetcher.h
diff --git a/components/ntp_snippets/ntp_snippets_fetcher.h b/components/ntp_snippets/ntp_snippets_fetcher.h
index b3cd393f8299607eef4b1c212d064b08e861c812..5a159ca27128ae3fe5e33da91c9a247958e2c36d 100644
--- a/components/ntp_snippets/ntp_snippets_fetcher.h
+++ b/components/ntp_snippets/ntp_snippets_fetcher.h
@@ -65,6 +65,9 @@ class NTPSnippetsFetcher : public OAuth2TokenService::Consumer,
RESULT_MAX
};
+ // Enumaration listing all possible variants of dealing with personalization.
Bernhard Bauer 2016/05/18 10:08:03 "Enumeration"
jkrcal 2016/05/19 07:30:28 Done.
+ enum class Personalization { kPersonal, kNonPersonal, kBoth };
Bernhard Bauer 2016/05/18 10:08:04 Put the values on individual lines :)
jkrcal 2016/05/19 07:30:28 One line is what "git cl format" produces. Should
Bernhard Bauer 2016/05/19 08:51:19 Yeah, it would be nice. I don't think clang-format
jkrcal 2016/05/19 10:58:16 I am afraid I do not understand. Do you suggest me
Bernhard Bauer 2016/05/19 11:05:46 That is correct. There are areas of the code base
jkrcal 2016/05/19 16:36:24 Done.
+
NTPSnippetsFetcher(
SigninManagerBase* signin_manager,
OAuth2TokenService* oauth2_token_service,
@@ -95,20 +98,24 @@ class NTPSnippetsFetcher : public OAuth2TokenService::Consumer,
return last_fetch_json_;
}
+ // Returns the last json fetched from the server.
Bernhard Bauer 2016/05/18 10:08:04 Nit: JSON
jkrcal 2016/05/19 07:30:28 Done.
+ const Personalization personalization() const { return personalization_; }
Bernhard Bauer 2016/05/18 10:08:04 Const for a return type that is by itself immutabl
jkrcal 2016/05/19 07:30:28 Thanks. Interestingly, it even does not compile on
+
+ // Does the fetcher use host restriction?
+ bool UseHostRestriction() const;
Bernhard Bauer 2016/05/18 10:08:03 Nit: "host restrictions" (plural). Also, "uses", s
jkrcal 2016/05/19 07:30:28 Done.
+ // Does the fetcher use authentication to get personalized results?
+ bool UseAuthentication() const;
Bernhard Bauer 2016/05/18 10:08:03 "Uses" here as well.
jkrcal 2016/05/19 07:30:28 Done.
+
// Overrides internal clock for testing purposes.
void SetTickClockForTesting(std::unique_ptr<base::TickClock> tick_clock) {
tick_clock_ = std::move(tick_clock);
}
private:
- enum class Personalization { kPersonal, kNonPersonal, kBoth };
-
void FetchSnippetsImpl(const GURL& url,
const std::string& auth_header,
const std::string& request);
std::string GetHostRestricts() const;
- bool UseHostRestriction() const;
- bool UseAuthentication() const;
void FetchSnippetsNonAuthenticated();
void FetchSnippetsAuthenticated(const std::string& account_id,
const std::string& oauth_access_token);

Powered by Google App Engine
This is Rietveld 408576698