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/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 StatusLabelStyle style, | 119 StatusLabelStyle style, |
120 string16* status_label, | 120 string16* status_label, |
121 string16* link_label) { | 121 string16* link_label) { |
122 DCHECK_EQ(status_label == NULL, link_label == NULL); | 122 DCHECK_EQ(status_label == NULL, link_label == NULL); |
123 | 123 |
124 MessageType result_type(SYNCED); | 124 MessageType result_type(SYNCED); |
125 | 125 |
126 if (signin.GetAuthenticatedUsername().empty()) | 126 if (signin.GetAuthenticatedUsername().empty()) |
127 return PRE_SYNCED; | 127 return PRE_SYNCED; |
128 | 128 |
129 if (!service || service->IsManaged() || service->HasSyncSetupCompleted()) { | 129 if (!service || service->IsManaged() || service->HasSyncSetupCompleted() || |
| 130 service->IsStartSuppressed()) { |
130 // The order or priority is going to be: 1. Unrecoverable errors. | 131 // The order or priority is going to be: 1. Unrecoverable errors. |
131 // 2. Auth errors. 3. Protocol errors. 4. Passphrase errors. | 132 // 2. Auth errors. 3. Protocol errors. 4. Passphrase errors. |
132 | 133 |
133 if (service && service->HasUnrecoverableError()) { | 134 if (service && service->HasUnrecoverableError()) { |
134 if (status_label) { | 135 if (status_label) { |
135 status_label->assign(l10n_util::GetStringFUTF16( | 136 status_label->assign(l10n_util::GetStringFUTF16( |
136 IDS_SYNC_STATUS_UNRECOVERABLE_ERROR, | 137 IDS_SYNC_STATUS_UNRECOVERABLE_ERROR, |
137 l10n_util::GetStringUTF16(IDS_SYNC_UNRECOVERABLE_ERROR_HELP_URL))); | 138 l10n_util::GetStringUTF16(IDS_SYNC_UNRECOVERABLE_ERROR_HELP_URL))); |
138 } | 139 } |
139 return SYNC_ERROR; | 140 return SYNC_ERROR; |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 string16 ConstructTime(int64 time_in_int) { | 338 string16 ConstructTime(int64 time_in_int) { |
338 base::Time time = base::Time::FromInternalValue(time_in_int); | 339 base::Time time = base::Time::FromInternalValue(time_in_int); |
339 | 340 |
340 // If time is null the format function returns a time in 1969. | 341 // If time is null the format function returns a time in 1969. |
341 if (time.is_null()) | 342 if (time.is_null()) |
342 return string16(); | 343 return string16(); |
343 return base::TimeFormatFriendlyDateAndTime(time); | 344 return base::TimeFormatFriendlyDateAndTime(time); |
344 } | 345 } |
345 | 346 |
346 } // namespace sync_ui_util | 347 } // namespace sync_ui_util |
OLD | NEW |