summaryrefslogtreecommitdiffstats
path: root/google_apis
diff options
context:
space:
mode:
authorsergeyu <sergeyu@chromium.org>2016-02-23 11:47:06 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-23 19:48:00 +0000
commitcb475fa1f6af24c5e010da6582cd8b655de67b7d (patch)
tree8306cf331488a626d936b673524130582819e661 /google_apis
parent9a1b4e02b007ab8a7414d2094a7259534e264f0b (diff)
downloadchromium_src-cb475fa1f6af24c5e010da6582cd8b655de67b7d.zip
chromium_src-cb475fa1f6af24c5e010da6582cd8b655de67b7d.tar.gz
chromium_src-cb475fa1f6af24c5e010da6582cd8b655de67b7d.tar.bz2
Add remoting API key in google_api
The API key will be used to access Google APIs that use it to authenticate the app. BUG=577954 Review URL: https://codereview.chromium.org/1704023002 Cr-Commit-Position: refs/heads/master@{#377063}
Diffstat (limited to 'google_apis')
-rw-r--r--google_apis/google_api_keys.cc18
-rw-r--r--google_apis/google_api_keys.h2
2 files changed, 20 insertions, 0 deletions
diff --git a/google_apis/google_api_keys.cc b/google_apis/google_api_keys.cc
index 52542cf..4721575 100644
--- a/google_apis/google_api_keys.cc
+++ b/google_apis/google_api_keys.cc
@@ -33,6 +33,10 @@
#define GOOGLE_API_KEY_SAFESITES DUMMY_API_TOKEN
#endif
+#if !defined(GOOGLE_API_KEY_REMOTING)
+#define GOOGLE_API_KEY_REMOTING DUMMY_API_TOKEN
+#endif
+
#if !defined(GOOGLE_CLIENT_ID_MAIN)
#define GOOGLE_CLIENT_ID_MAIN DUMMY_API_TOKEN
#endif
@@ -104,6 +108,14 @@ class APIKeyCache {
environment.get(),
command_line);
+ api_key_remoting_ =
+ CalculateKeyValue(GOOGLE_API_KEY_REMOTING,
+ STRINGIZE_NO_EXPANSION(GOOGLE_API_KEY_REMOTING),
+ NULL,
+ std::string(),
+ environment.get(),
+ command_line);
+
std::string default_client_id =
CalculateKeyValue(GOOGLE_DEFAULT_CLIENT_ID,
STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_ID),
@@ -188,6 +200,7 @@ class APIKeyCache {
std::string api_key() const { return api_key_; }
std::string api_key_safesites() const { return api_key_safesites_; }
+ std::string api_key_remoting() const { return api_key_remoting_; }
std::string GetClientID(OAuth2Client client) const {
DCHECK_LT(client, CLIENT_NUM_ITEMS);
@@ -254,6 +267,7 @@ class APIKeyCache {
std::string api_key_;
std::string api_key_safesites_;
+ std::string api_key_remoting_;
std::string client_ids_[CLIENT_NUM_ITEMS];
std::string client_secrets_[CLIENT_NUM_ITEMS];
};
@@ -284,6 +298,10 @@ std::string GetSafeSitesAPIKey() {
return g_api_key_cache.Get().api_key_safesites();
}
+std::string GetRemotingAPIKey() {
+ return g_api_key_cache.Get().api_key_remoting();
+}
+
std::string GetOAuth2ClientID(OAuth2Client client) {
return g_api_key_cache.Get().GetClientID(client);
}
diff --git a/google_apis/google_api_keys.h b/google_apis/google_api_keys.h
index b4b6fac..56f91c3 100644
--- a/google_apis/google_api_keys.h
+++ b/google_apis/google_api_keys.h
@@ -70,6 +70,8 @@ std::string GetAPIKey();
std::string GetSafeSitesAPIKey();
+std::string GetRemotingAPIKey();
+
// Represents the different sets of client IDs and secrets in use.
enum OAuth2Client {
CLIENT_MAIN, // Several different features use this.