| 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 "components/signin/core/browser/about_signin_internals.h" | 5 #include "components/signin/core/browser/about_signin_internals.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/hash.h" | 8 #include "base/hash.h" |
| 9 #include "base/i18n/time_formatting.h" | 9 #include "base/i18n/time_formatting.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/prefs/pref_service.h" | 11 #include "base/prefs/pref_service.h" |
| 12 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
| 13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
| 14 #include "components/signin/core/browser/profile_oauth2_token_service.h" | 14 #include "components/signin/core/browser/profile_oauth2_token_service.h" |
| 15 #include "components/signin/core/browser/signin_client.h" | 15 #include "components/signin/core/browser/signin_client.h" |
| 16 #include "components/signin/core/browser/signin_internals_util.h" | 16 #include "components/signin/core/browser/signin_internals_util.h" |
| 17 #include "components/signin/core/browser/signin_manager.h" | 17 #include "components/signin/core/browser/signin_manager.h" |
| 18 #include "components/signin/core/common/profile_management_switches.h" |
| 18 #include "google_apis/gaia/gaia_constants.h" | 19 #include "google_apis/gaia/gaia_constants.h" |
| 19 | 20 |
| 20 using base::Time; | 21 using base::Time; |
| 21 using namespace signin_internals_util; | 22 using namespace signin_internals_util; |
| 22 | 23 |
| 23 namespace { | 24 namespace { |
| 24 | 25 |
| 25 std::string GetTimeStr(base::Time time) { | 26 std::string GetTimeStr(base::Time time) { |
| 26 return base::UTF16ToUTF8(base::TimeFormatShortDateAndTime(time)); | 27 return base::UTF16ToUTF8(base::TimeFormatShortDateAndTime(time)); |
| 27 } | 28 } |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 signin_status->Set("signin_info", signin_info); | 339 signin_status->Set("signin_info", signin_info); |
| 339 | 340 |
| 340 // A summary of signin related info first. | 341 // A summary of signin related info first. |
| 341 base::ListValue* basic_info = AddSection(signin_info, "Basic Information"); | 342 base::ListValue* basic_info = AddSection(signin_info, "Basic Information"); |
| 342 const std::string signin_status_string = | 343 const std::string signin_status_string = |
| 343 untimed_signin_fields[USERNAME - UNTIMED_FIELDS_BEGIN].empty() | 344 untimed_signin_fields[USERNAME - UNTIMED_FIELDS_BEGIN].empty() |
| 344 ? "Not Signed In" | 345 ? "Not Signed In" |
| 345 : "Signed In"; | 346 : "Signed In"; |
| 346 AddSectionEntry(basic_info, "Chrome Version", product_version); | 347 AddSectionEntry(basic_info, "Chrome Version", product_version); |
| 347 AddSectionEntry(basic_info, "Signin Status", signin_status_string); | 348 AddSectionEntry(basic_info, "Signin Status", signin_status_string); |
| 349 AddSectionEntry(basic_info, "Web Based Signin Enabled?", |
| 350 switches::IsEnableWebBasedSignin() == TRUE ? "True" : "False"); |
| 351 AddSectionEntry(basic_info, "New Profile Management Enabled?", |
| 352 switches::IsNewProfileManagement() == TRUE ? "True" : "False"); |
| 348 | 353 |
| 349 // Only add username. SID and LSID have moved to tokens section. | 354 // Only add username. SID and LSID have moved to tokens section. |
| 350 const std::string field = | 355 const std::string field = |
| 351 SigninStatusFieldToLabel(static_cast<UntimedSigninStatusField>(USERNAME)); | 356 SigninStatusFieldToLabel(static_cast<UntimedSigninStatusField>(USERNAME)); |
| 352 AddSectionEntry(basic_info, | 357 AddSectionEntry(basic_info, |
| 353 field, | 358 field, |
| 354 untimed_signin_fields[USERNAME - UNTIMED_FIELDS_BEGIN]); | 359 untimed_signin_fields[USERNAME - UNTIMED_FIELDS_BEGIN]); |
| 355 | 360 |
| 356 // Time and status information of the possible sign in types. | 361 // Time and status information of the possible sign in types. |
| 357 base::ListValue* detailed_info = | 362 base::ListValue* detailed_info = |
| (...skipping 23 matching lines...) Expand all Loading... |
| 381 std::sort(it->second.begin(), it->second.end(), TokenInfo::LessThan); | 386 std::sort(it->second.begin(), it->second.end(), TokenInfo::LessThan); |
| 382 const std::vector<TokenInfo*>& tokens = it->second; | 387 const std::vector<TokenInfo*>& tokens = it->second; |
| 383 for (size_t i = 0; i < tokens.size(); ++i) { | 388 for (size_t i = 0; i < tokens.size(); ++i) { |
| 384 base::DictionaryValue* token_info = tokens[i]->ToValue(); | 389 base::DictionaryValue* token_info = tokens[i]->ToValue(); |
| 385 token_details->Append(token_info); | 390 token_details->Append(token_info); |
| 386 } | 391 } |
| 387 } | 392 } |
| 388 | 393 |
| 389 return signin_status.Pass(); | 394 return signin_status.Pass(); |
| 390 } | 395 } |
| OLD | NEW |