summaryrefslogtreecommitdiffstats
path: root/google_apis/google_api_keys.cc
diff options
context:
space:
mode:
authorkinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-17 13:55:20 +0000
committerkinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-17 13:55:20 +0000
commite4b54e3e6f3086905b27cdcfe86667d0ad157f94 (patch)
tree806f5f7978af0a104e4283432108cf40c0ff4c5a /google_apis/google_api_keys.cc
parent4ed078d35441b584ca576cb28869979061037f70 (diff)
downloadchromium_src-e4b54e3e6f3086905b27cdcfe86667d0ad157f94.zip
chromium_src-e4b54e3e6f3086905b27cdcfe86667d0ad157f94.tar.gz
chromium_src-e4b54e3e6f3086905b27cdcfe86667d0ad157f94.tar.bz2
Add a function for determining if official Google Chrome API key is used.
I'd like to add this for handling several features of Google Drive API that is only available for whitelisted first-party client. By checking the key by the newly added function, we can provide better fallbacks for clients with third-party keys, instead of just failing. BUG=332332, 324166 Review URL: https://codereview.chromium.org/131743018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245504 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'google_apis/google_api_keys.cc')
-rw-r--r--google_apis/google_api_keys.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/google_apis/google_api_keys.cc b/google_apis/google_api_keys.cc
index 94f6812..2cf92fd 100644
--- a/google_apis/google_api_keys.cc
+++ b/google_apis/google_api_keys.cc
@@ -269,4 +269,12 @@ std::string GetOAuth2ClientSecret(OAuth2Client client) {
return g_api_key_cache.Get().GetClientSecret(client);
}
+bool IsGoogleChromeAPIKeyUsed() {
+#if defined(GOOGLE_CHROME_BUILD) || defined(USE_OFFICIAL_GOOGLE_API_KEYS)
+ return true;
+#else
+ return false;
+#endif
+}
+
} // namespace google_apis