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 | 9 |
10 #include <stddef.h> | 10 #include <stddef.h> |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 return key_value; | 282 return key_value; |
283 } | 283 } |
284 | 284 |
285 std::string api_key_; | 285 std::string api_key_; |
286 std::string api_key_non_stable_; | 286 std::string api_key_non_stable_; |
287 std::string api_key_remoting_; | 287 std::string api_key_remoting_; |
288 std::string client_ids_[CLIENT_NUM_ITEMS]; | 288 std::string client_ids_[CLIENT_NUM_ITEMS]; |
289 std::string client_secrets_[CLIENT_NUM_ITEMS]; | 289 std::string client_secrets_[CLIENT_NUM_ITEMS]; |
290 }; | 290 }; |
291 | 291 |
292 static base::LazyInstance<APIKeyCache> g_api_key_cache = | 292 static base::LazyInstance<APIKeyCache>::DestructorAtExit g_api_key_cache = |
293 LAZY_INSTANCE_INITIALIZER; | 293 LAZY_INSTANCE_INITIALIZER; |
294 | 294 |
295 bool HasKeysConfigured() { | 295 bool HasKeysConfigured() { |
296 if (GetAPIKey() == DUMMY_API_TOKEN) | 296 if (GetAPIKey() == DUMMY_API_TOKEN) |
297 return false; | 297 return false; |
298 | 298 |
299 for (size_t client_id = 0; client_id < CLIENT_NUM_ITEMS; ++client_id) { | 299 for (size_t client_id = 0; client_id < CLIENT_NUM_ITEMS; ++client_id) { |
300 OAuth2Client client = static_cast<OAuth2Client>(client_id); | 300 OAuth2Client client = static_cast<OAuth2Client>(client_id); |
301 if (GetOAuth2ClientID(client) == DUMMY_API_TOKEN || | 301 if (GetOAuth2ClientID(client) == DUMMY_API_TOKEN || |
302 GetOAuth2ClientSecret(client) == DUMMY_API_TOKEN) { | 302 GetOAuth2ClientSecret(client) == DUMMY_API_TOKEN) { |
(...skipping 30 matching lines...) Expand all Loading... |
333 | 333 |
334 bool IsGoogleChromeAPIKeyUsed() { | 334 bool IsGoogleChromeAPIKeyUsed() { |
335 #if defined(GOOGLE_CHROME_BUILD) || defined(USE_OFFICIAL_GOOGLE_API_KEYS) | 335 #if defined(GOOGLE_CHROME_BUILD) || defined(USE_OFFICIAL_GOOGLE_API_KEYS) |
336 return true; | 336 return true; |
337 #else | 337 #else |
338 return false; | 338 return false; |
339 #endif | 339 #endif |
340 } | 340 } |
341 | 341 |
342 } // namespace google_apis | 342 } // namespace google_apis |
OLD | NEW |