| 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/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 // empty string is returned. | 52 // empty string is returned. |
| 53 base::string16 GetSyncedStateStatusLabel(ProfileSyncService* service, | 53 base::string16 GetSyncedStateStatusLabel(ProfileSyncService* service, |
| 54 const SigninManagerBase& signin, | 54 const SigninManagerBase& signin, |
| 55 StatusLabelStyle style) { | 55 StatusLabelStyle style) { |
| 56 std::string user_display_name = signin.GetAuthenticatedUsername(); | 56 std::string user_display_name = signin.GetAuthenticatedUsername(); |
| 57 | 57 |
| 58 #if defined(OS_CHROMEOS) | 58 #if defined(OS_CHROMEOS) |
| 59 if (chromeos::UserManager::IsInitialized()) { | 59 if (chromeos::UserManager::IsInitialized()) { |
| 60 // On CrOS user email is sanitized and then passed to the signin manager. | 60 // On CrOS user email is sanitized and then passed to the signin manager. |
| 61 // Original email (containing dots) is stored as "display email". | 61 // Original email (containing dots) is stored as "display email". |
| 62 user_display_name = chromeos::UserManager::Get()-> | 62 user_display_name = |
| 63 GetUserDisplayEmail(user_display_name); | 63 chromeos::GetUserManager()->GetUserDisplayEmail(user_display_name); |
| 64 } | 64 } |
| 65 #endif // defined(OS_CHROMEOS) | 65 #endif // defined(OS_CHROMEOS) |
| 66 | 66 |
| 67 base::string16 user_name = base::UTF8ToUTF16(user_display_name); | 67 base::string16 user_name = base::UTF8ToUTF16(user_display_name); |
| 68 | 68 |
| 69 if (!user_name.empty()) { | 69 if (!user_name.empty()) { |
| 70 if (!service || service->IsManaged()) { | 70 if (!service || service->IsManaged()) { |
| 71 // User is signed in, but sync is disabled. | 71 // User is signed in, but sync is disabled. |
| 72 return l10n_util::GetStringFUTF16(IDS_SIGNED_IN_WITH_SYNC_DISABLED, | 72 return l10n_util::GetStringFUTF16(IDS_SIGNED_IN_WITH_SYNC_DISABLED, |
| 73 user_name); | 73 user_name); |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 base::string16 ConstructTime(int64 time_in_int) { | 380 base::string16 ConstructTime(int64 time_in_int) { |
| 381 base::Time time = base::Time::FromInternalValue(time_in_int); | 381 base::Time time = base::Time::FromInternalValue(time_in_int); |
| 382 | 382 |
| 383 // If time is null the format function returns a time in 1969. | 383 // If time is null the format function returns a time in 1969. |
| 384 if (time.is_null()) | 384 if (time.is_null()) |
| 385 return base::string16(); | 385 return base::string16(); |
| 386 return base::TimeFormatFriendlyDateAndTime(time); | 386 return base::TimeFormatFriendlyDateAndTime(time); |
| 387 } | 387 } |
| 388 | 388 |
| 389 } // namespace sync_ui_util | 389 } // namespace sync_ui_util |
| OLD | NEW |