| 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 "chrome/browser/signin/signin_internals_util.h" | 5 #include "chrome/browser/signin/signin_internals_util.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "base/hash.h" | 9 #include "base/hash.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "chrome/common/chrome_version_info.h" | 11 #include "chrome/common/chrome_version_info.h" |
| 12 #include "chrome/common/extensions/extension_messages.h" | 12 #include "chrome/common/extensions/extension_messages.h" |
| 13 #include "chrome/common/url_constants.h" | 13 #include "chrome/common/url_constants.h" |
| 14 #include "content/public/browser/web_contents.h" | 14 #include "content/public/browser/web_contents.h" |
| 15 #include "google_apis/gaia/gaia_constants.h" | 15 #include "google_apis/gaia/gaia_constants.h" |
| 16 | 16 |
| 17 namespace signin_internals_util { | 17 namespace signin_internals_util { |
| 18 | 18 |
| 19 const char kSigninPrefPrefix[] = "google.services.signin."; | 19 const char kSigninPrefPrefix[] = "google.services.signin."; |
| 20 const char kTokenPrefPrefix[] = "google.services.signin.tokens."; | 20 const char kTokenPrefPrefix[] = "google.services.signin.tokens."; |
| 21 const char kChromeToMobileToken[] = "ChromeToMobile"; | 21 const char kChromeToMobileToken[] = "ChromeToMobile"; |
| 22 const char kAppNotifyChannelSetupToken[] = "AppNotifyChannelSetup"; | 22 const char kAppNotifyChannelSetupToken[] = "AppNotifyChannelSetup"; |
| 23 const char kOperationsBaseToken[] = "OperationsBase"; | 23 const char kAuthOperationToken[] = "AuthOperation"; |
| 24 const char kUserPolicySigninServiceToken[] = "UserCloudPolicyManagerToken"; | 24 const char kUserPolicySigninServiceToken[] = "UserCloudPolicyManager"; |
| 25 const char kProfileDownloaderToken[] = "ProfileDownloader"; | 25 const char kProfileDownloaderToken[] = "ProfileDownloader"; |
| 26 | 26 |
| 27 // TODO(vishwath): These two services need their information plumbed to | 27 // TODO(vishwath): These two services need their information plumbed to |
| 28 // about:signin-internals. | 28 // about:signin-internals, and then added to the array below. |
| 29 const char kObfuscatedGaiaIdFetcherToken[] = "ObfuscatedGaiaIdFetcher"; | 29 const char kObfuscatedGaiaIdFetcherToken[] = "ObfuscatedGaiaIdFetcher"; |
| 30 const char kOAuth2MintTokenFlowToken[] = "OAuth2MintTokenFlow"; | 30 const char kOAuth2MintTokenFlowToken[] = "OAuth2MintTokenFlow"; |
| 31 |
| 31 const char* kTokenPrefsArray[] = { | 32 const char* kTokenPrefsArray[] = { |
| 32 GaiaConstants::kGaiaService, | 33 GaiaConstants::kGaiaService, |
| 33 GaiaConstants::kSyncService, | 34 GaiaConstants::kSyncService, |
| 34 GaiaConstants::kDeviceManagementService, | 35 GaiaConstants::kDeviceManagementService, |
| 35 GaiaConstants::kLSOService, | 36 GaiaConstants::kLSOService, |
| 36 GaiaConstants::kGaiaOAuth2LoginRefreshToken, | 37 GaiaConstants::kGaiaOAuth2LoginRefreshToken, |
| 37 GaiaConstants::kGaiaOAuth2LoginAccessToken, | 38 GaiaConstants::kGaiaOAuth2LoginAccessToken, |
| 38 kChromeToMobileToken, | 39 kChromeToMobileToken, |
| 39 kAppNotifyChannelSetupToken, | 40 kAppNotifyChannelSetupToken, |
| 40 kOperationsBaseToken, | 41 kAuthOperationToken, |
| 41 kUserPolicySigninServiceToken, | 42 kUserPolicySigninServiceToken, |
| 42 kProfileDownloaderToken, | 43 kProfileDownloaderToken, |
| 43 kObfuscatedGaiaIdFetcherToken, | |
| 44 kOAuth2MintTokenFlowToken | |
| 45 }; | 44 }; |
| 46 | 45 |
| 47 const size_t kNumTokenPrefs = arraysize(kTokenPrefsArray); | 46 const size_t kNumTokenPrefs = arraysize(kTokenPrefsArray); |
| 48 | 47 |
| 49 TokenInfo::TokenInfo(const std::string& tok, | 48 TokenInfo::TokenInfo(const std::string& tok, |
| 50 const std::string& stat, | 49 const std::string& stat, |
| 51 const std::string & tstamp, | 50 const std::string & tstamp, |
| 52 const std::string srvice) | 51 const std::string srvice) |
| 53 : token(tok) | 52 : token(tok) |
| 54 , status(stat) | 53 , status(stat) |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 for (std::map<std::string, TokenInfo>::iterator it = token_info_map.begin(); | 265 for (std::map<std::string, TokenInfo>::iterator it = token_info_map.begin(); |
| 267 it != token_info_map.end(); ++it) { | 266 it != token_info_map.end(); ++it) { |
| 268 DictionaryValue* token_info = it->second.ToValue(); | 267 DictionaryValue* token_info = it->second.ToValue(); |
| 269 token_details->Append(token_info); | 268 token_details->Append(token_info); |
| 270 } | 269 } |
| 271 | 270 |
| 272 return signin_status.Pass(); | 271 return signin_status.Pass(); |
| 273 } | 272 } |
| 274 | 273 |
| 275 } // namespace signin_internals_util | 274 } // namespace signin_internals_util |
| OLD | NEW |