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

Unified Diff: google_apis/google_api_keys.cc

Issue 2786033002: Expose way to set google api key through CWVWebView class method. (Closed)
Patch Set: fix dependency Created 3 years, 8 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
« no previous file with comments | « google_apis/google_api_keys.h ('k') | google_apis/google_api_keys_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..ab92d1e4dccf7420e8c0b72b49b8f8343c995016 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,17 @@ 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);
+}
+
+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();
}
« no previous file with comments | « google_apis/google_api_keys.h ('k') | google_apis/google_api_keys_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698