Chromium Code Reviews| Index: google_apis/google_api_keys.cc |
| diff --git a/google_apis/google_api_keys.cc b/google_apis/google_api_keys.cc |
| index 06a53e2476f568824c6e6523f14e20f132ea1c4d..a5e81d1a42766b8c1847a555c412bbaff2faeccc 100644 |
| --- a/google_apis/google_api_keys.cc |
| +++ b/google_apis/google_api_keys.cc |
| @@ -206,6 +206,9 @@ class APIKeyCache { |
| } |
| std::string api_key() const { return api_key_; } |
| +#if defined(OS_IOS) |
| + void set_api_key(const std::string& api_key) { api_key_ = api_key; } |
| +#endif |
| std::string api_key_non_stable() const { return api_key_non_stable_; } |
| std::string api_key_remoting() const { return api_key_remoting_; } |
| @@ -214,11 +217,23 @@ class APIKeyCache { |
| return client_ids_[client]; |
| } |
| +#if defined(OS_IOS) |
| + void SetClientID(OAuth2Client client, const std::string& client_id) { |
| + client_ids_[client] = client_id; |
| + } |
| +#endif |
| + |
| std::string GetClientSecret(OAuth2Client client) const { |
| DCHECK_LT(client, CLIENT_NUM_ITEMS); |
| return client_secrets_[client]; |
| } |
| +#if defined(OS_IOS) |
| + void SetClientSecret(OAuth2Client client, const std::string& client_secret) { |
| + client_secrets_[client] = client_secret; |
| + } |
| +#endif |
| + |
| std::string GetSpdyProxyAuthValue() { |
| #if defined(SPDY_PROXY_AUTH_VALUE) |
| return SPDY_PROXY_AUTH_VALUE; |
| @@ -319,6 +334,12 @@ std::string GetRemotingAPIKey() { |
| return g_api_key_cache.Get().api_key_remoting(); |
| } |
| +#if defined(OS_IOS) |
| +void SetAPIKey(const std::string& api_key) { |
| + g_api_key_cache.Get().set_api_key(api_key); |
| +} |
| +#endif |
| + |
| std::string GetOAuth2ClientID(OAuth2Client client) { |
| return g_api_key_cache.Get().GetClientID(client); |
| } |
| @@ -327,6 +348,19 @@ std::string GetOAuth2ClientSecret(OAuth2Client client) { |
| return g_api_key_cache.Get().GetClientSecret(client); |
| } |
| +#if defined(OS_IOS) |
| +void SetOAuth2ClientID(OAuth2Client client, const std::string& client_id) { |
| + g_api_key_cache.Get().SetClientID(client, client_id); |
| +} |
| +#endif |
| + |
| +#if defined(OS_IOS) |
|
michaeldo
2017/04/14 15:25:55
nit: Put both of these methods inside a single #if
jzw1
2017/04/17 01:41:20
Done.
|
| +void SetOAuth2ClientSecret(OAuth2Client client, |
| + const std::string& client_secret) { |
| + g_api_key_cache.Get().SetClientSecret(client, client_secret); |
| +} |
| +#endif |
| + |
| std::string GetSpdyProxyAuthValue() { |
| return g_api_key_cache.Get().GetSpdyProxyAuthValue(); |
| } |