| 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/sync/sync_ui_util.h" | 5 #include "chrome/browser/sync/sync_ui_util.h" |
| 6 | 6 |
| 7 #include "base/i18n/number_formatting.h" | 7 #include "base/i18n/number_formatting.h" |
| 8 #include "base/i18n/time_formatting.h" | 8 #include "base/i18n/time_formatting.h" |
| 9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 base::string16 GetSyncedStateStatusLabel(ProfileSyncService* service, | 56 base::string16 GetSyncedStateStatusLabel(ProfileSyncService* service, |
| 57 const SigninManagerBase& signin, | 57 const SigninManagerBase& signin, |
| 58 StatusLabelStyle style) { | 58 StatusLabelStyle style) { |
| 59 std::string user_display_name = signin.GetAuthenticatedUsername(); | 59 std::string user_display_name = signin.GetAuthenticatedUsername(); |
| 60 | 60 |
| 61 #if defined(OS_CHROMEOS) | 61 #if defined(OS_CHROMEOS) |
| 62 if (user_manager::UserManager::IsInitialized()) { | 62 if (user_manager::UserManager::IsInitialized()) { |
| 63 // On CrOS user email is sanitized and then passed to the signin manager. | 63 // On CrOS user email is sanitized and then passed to the signin manager. |
| 64 // Original email (containing dots) is stored as "display email". | 64 // Original email (containing dots) is stored as "display email". |
| 65 user_display_name = user_manager::UserManager::Get()->GetUserDisplayEmail( | 65 user_display_name = user_manager::UserManager::Get()->GetUserDisplayEmail( |
| 66 user_display_name); | 66 user_manager::UserID::FromUserEmail(user_display_name)); |
| 67 } | 67 } |
| 68 #endif // defined(OS_CHROMEOS) | 68 #endif // defined(OS_CHROMEOS) |
| 69 | 69 |
| 70 base::string16 user_name = base::UTF8ToUTF16(user_display_name); | 70 base::string16 user_name = base::UTF8ToUTF16(user_display_name); |
| 71 | 71 |
| 72 if (!user_name.empty()) { | 72 if (!user_name.empty()) { |
| 73 if (!service || service->IsManaged()) { | 73 if (!service || service->IsManaged()) { |
| 74 // User is signed in, but sync is disabled. | 74 // User is signed in, but sync is disabled. |
| 75 return l10n_util::GetStringFUTF16(IDS_SIGNED_IN_WITH_SYNC_DISABLED, | 75 return l10n_util::GetStringFUTF16(IDS_SIGNED_IN_WITH_SYNC_DISABLED, |
| 76 user_name); | 76 user_name); |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 base::string16 ConstructTime(int64 time_in_int) { | 389 base::string16 ConstructTime(int64 time_in_int) { |
| 390 base::Time time = base::Time::FromInternalValue(time_in_int); | 390 base::Time time = base::Time::FromInternalValue(time_in_int); |
| 391 | 391 |
| 392 // If time is null the format function returns a time in 1969. | 392 // If time is null the format function returns a time in 1969. |
| 393 if (time.is_null()) | 393 if (time.is_null()) |
| 394 return base::string16(); | 394 return base::string16(); |
| 395 return base::TimeFormatFriendlyDateAndTime(time); | 395 return base::TimeFormatFriendlyDateAndTime(time); |
| 396 } | 396 } |
| 397 | 397 |
| 398 } // namespace sync_ui_util | 398 } // namespace sync_ui_util |
| OLD | NEW |