| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "google_apis/google_api_keys.h" | 5 #include "google_apis/google_api_keys.h" |
| 6 | 6 |
| 7 // If you add more includes to this list, you also need to add them to | 7 // If you add more includes to this list, you also need to add them to |
| 8 // google_api_keys_unittest.cc. | 8 // google_api_keys_unittest.cc. |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/environment.h" | 10 #include "base/environment.h" |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 } | 176 } |
| 177 | 177 |
| 178 std::string GetClientSecret(OAuth2Client client) const { | 178 std::string GetClientSecret(OAuth2Client client) const { |
| 179 DCHECK_LT(client, CLIENT_NUM_ITEMS); | 179 DCHECK_LT(client, CLIENT_NUM_ITEMS); |
| 180 return client_secrets_[client]; | 180 return client_secrets_[client]; |
| 181 } | 181 } |
| 182 | 182 |
| 183 std::string GetSpdyProxyAuthValue() { | 183 std::string GetSpdyProxyAuthValue() { |
| 184 #if defined(SPDY_PROXY_AUTH_VALUE) | 184 #if defined(SPDY_PROXY_AUTH_VALUE) |
| 185 return SPDY_PROXY_AUTH_VALUE; | 185 return SPDY_PROXY_AUTH_VALUE; |
| 186 #else |
| 187 return std::string(); |
| 186 #endif | 188 #endif |
| 187 return std::string(); | |
| 188 } | 189 } |
| 189 | 190 |
| 190 private: | 191 private: |
| 191 // Gets a value for a key. In priority order, this will be the value | 192 // Gets a value for a key. In priority order, this will be the value |
| 192 // provided via a command-line switch, the value provided via an | 193 // provided via a command-line switch, the value provided via an |
| 193 // environment variable, or finally a value baked into the build. | 194 // environment variable, or finally a value baked into the build. |
| 194 // |command_line_switch| may be NULL. | 195 // |command_line_switch| may be NULL. |
| 195 static std::string CalculateKeyValue(const char* baked_in_value, | 196 static std::string CalculateKeyValue(const char* baked_in_value, |
| 196 const char* environment_variable_name, | 197 const char* environment_variable_name, |
| 197 const char* command_line_switch, | 198 const char* command_line_switch, |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 | 274 |
| 274 bool IsGoogleChromeAPIKeyUsed() { | 275 bool IsGoogleChromeAPIKeyUsed() { |
| 275 #if defined(GOOGLE_CHROME_BUILD) || defined(USE_OFFICIAL_GOOGLE_API_KEYS) | 276 #if defined(GOOGLE_CHROME_BUILD) || defined(USE_OFFICIAL_GOOGLE_API_KEYS) |
| 276 return true; | 277 return true; |
| 277 #else | 278 #else |
| 278 return false; | 279 return false; |
| 279 #endif | 280 #endif |
| 280 } | 281 } |
| 281 | 282 |
| 282 } // namespace google_apis | 283 } // namespace google_apis |
| OLD | NEW |