| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 // NOT first machine. | 224 // NOT first machine. |
| 225 // Show a link ("needs attention"), but still indicate the | 225 // Show a link ("needs attention"), but still indicate the |
| 226 // current synced status. Return SYNC_PROMO so that | 226 // current synced status. Return SYNC_PROMO so that |
| 227 // the configure link will still be shown. | 227 // the configure link will still be shown. |
| 228 if (status_label && link_label) { | 228 if (status_label && link_label) { |
| 229 status_label->assign(GetSyncedStateStatusLabel(service)); | 229 status_label->assign(GetSyncedStateStatusLabel(service)); |
| 230 link_label->assign( | 230 link_label->assign( |
| 231 l10n_util::GetStringUTF16(IDS_SYNC_PASSWORD_SYNC_ATTENTION)); | 231 l10n_util::GetStringUTF16(IDS_SYNC_PASSWORD_SYNC_ATTENTION)); |
| 232 } | 232 } |
| 233 return SYNC_PROMO; | 233 return SYNC_PROMO; |
| 234 } else { | |
| 235 // First machine. Don't show promotion, just show everything | |
| 236 // normal. | |
| 237 if (status_label) | |
| 238 status_label->assign(GetSyncedStateStatusLabel(service)); | |
| 239 return SYNCED; | |
| 240 } | 234 } |
| 241 } | 235 } |
| 236 |
| 237 // There is no error. Display "Last synced..." message. |
| 238 if (status_label) |
| 239 status_label->assign(GetSyncedStateStatusLabel(service)); |
| 242 return SYNCED; | 240 return SYNCED; |
| 243 } else { | 241 } else { |
| 244 // Either show auth error information with a link to re-login, auth in prog, | 242 // Either show auth error information with a link to re-login, auth in prog, |
| 245 // or provide a link to continue with setup. | 243 // or provide a link to continue with setup. |
| 246 result_type = PRE_SYNCED; | 244 result_type = PRE_SYNCED; |
| 247 if (service->SetupInProgress()) { | 245 if (service->SetupInProgress()) { |
| 248 ProfileSyncService::Status status(service->QueryDetailedSyncStatus()); | 246 ProfileSyncService::Status status(service->QueryDetailedSyncStatus()); |
| 249 const AuthError& auth_error = service->GetAuthError(); | 247 const AuthError& auth_error = service->GetAuthError(); |
| 250 if (status_label) { | 248 if (status_label) { |
| 251 status_label->assign( | 249 status_label->assign( |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 DictionaryValue* val = new DictionaryValue; | 644 DictionaryValue* val = new DictionaryValue; |
| 647 val->SetString("model_type", ModelTypeToString(it->first)); | 645 val->SetString("model_type", ModelTypeToString(it->first)); |
| 648 val->SetString("group", ModelSafeGroupToString(it->second)); | 646 val->SetString("group", ModelSafeGroupToString(it->second)); |
| 649 routing_info->Append(val); | 647 routing_info->Append(val); |
| 650 } | 648 } |
| 651 } | 649 } |
| 652 } | 650 } |
| 653 } | 651 } |
| 654 | 652 |
| 655 } // namespace sync_ui_util | 653 } // namespace sync_ui_util |
| OLD | NEW |