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/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
284 l10n_util::GetStringUTF16(IDS_SYNC_AUTHENTICATING_LABEL)); | 284 l10n_util::GetStringUTF16(IDS_SYNC_AUTHENTICATING_LABEL)); |
285 } | 285 } |
286 } else if (auth_error.state() != AuthError::NONE && | 286 } else if (auth_error.state() != AuthError::NONE && |
287 auth_error.state() != AuthError::TWO_FACTOR) { | 287 auth_error.state() != AuthError::TWO_FACTOR) { |
288 if (status_label) { | 288 if (status_label) { |
289 status_label->clear(); | 289 status_label->clear(); |
290 GetStatusLabelsForAuthError(auth_error, *service, status_label, NULL, | 290 GetStatusLabelsForAuthError(auth_error, *service, status_label, NULL, |
291 NULL, NULL, NULL); | 291 NULL, NULL, NULL); |
292 } | 292 } |
293 result_type = SYNC_ERROR; | 293 result_type = SYNC_ERROR; |
294 } else if (!status.authenticated) { | |
rlarocque
2012/02/08 01:57:29
Fred and I are reasonably convinced this is dead c
| |
295 if (status_label) { | |
296 status_label->assign( | |
297 l10n_util::GetStringUTF16(IDS_SYNC_ACCOUNT_DETAILS_NOT_ENTERED)); | |
298 } | |
299 } | 294 } |
300 } else if (service->unrecoverable_error_detected()) { | 295 } else if (service->unrecoverable_error_detected()) { |
301 result_type = SYNC_ERROR; | 296 result_type = SYNC_ERROR; |
302 ProfileSyncService::Status status(service->QueryDetailedSyncStatus()); | 297 ProfileSyncService::Status status(service->QueryDetailedSyncStatus()); |
303 if (ShouldShowActionOnUI(status.sync_protocol_error)) { | 298 if (ShouldShowActionOnUI(status.sync_protocol_error)) { |
304 if (status_label) { | 299 if (status_label) { |
305 GetStatusForActionableError(status.sync_protocol_error, | 300 GetStatusForActionableError(status.sync_protocol_error, |
306 status_label); | 301 status_label); |
307 } | 302 } |
308 } else if (status_label) { | 303 } else if (status_label) { |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
505 } else { | 500 } else { |
506 sync_api::SyncManager::Status full_status( | 501 sync_api::SyncManager::Status full_status( |
507 service->QueryDetailedSyncStatus()); | 502 service->QueryDetailedSyncStatus()); |
508 | 503 |
509 strings->SetString("service_url", service->sync_service_url().spec()); | 504 strings->SetString("service_url", service->sync_service_url().spec()); |
510 strings->SetString("summary", | 505 strings->SetString("summary", |
511 ProfileSyncService::BuildSyncStatusSummaryText( | 506 ProfileSyncService::BuildSyncStatusSummaryText( |
512 full_status.summary)); | 507 full_status.summary)); |
513 | 508 |
514 strings->SetString("version", GetVersionString()); | 509 strings->SetString("version", GetVersionString()); |
515 strings->Set("authenticated", | |
516 new base::FundamentalValue(full_status.authenticated)); | |
517 strings->SetString("auth_problem", | 510 strings->SetString("auth_problem", |
518 sync_ui_util::MakeSyncAuthErrorText( | 511 sync_ui_util::MakeSyncAuthErrorText( |
519 service->GetAuthError().state())); | 512 service->GetAuthError().state())); |
520 | 513 |
521 strings->SetString("time_since_sync", service->GetLastSyncedTimeString()); | 514 strings->SetString("time_since_sync", service->GetLastSyncedTimeString()); |
522 | 515 |
523 ListValue* details = new ListValue(); | 516 ListValue* details = new ListValue(); |
524 strings->Set("details", details); | 517 strings->Set("details", details); |
525 sync_ui_util::AddBoolSyncDetail(details, "Sync Initialized", | 518 sync_ui_util::AddBoolSyncDetail(details, "Sync Initialized", |
526 service->sync_initialized()); | 519 service->sync_initialized()); |
527 sync_ui_util::AddBoolSyncDetail(details, "Sync Setup Has Completed", | 520 sync_ui_util::AddBoolSyncDetail(details, "Sync Setup Has Completed", |
528 service->HasSyncSetupCompleted()); | 521 service->HasSyncSetupCompleted()); |
529 sync_ui_util::AddStringSyncDetails( | 522 sync_ui_util::AddStringSyncDetails( |
530 details, | 523 details, |
531 "Client ID", | 524 "Client ID", |
532 full_status.unique_id.empty() ? "none" : full_status.unique_id); | 525 full_status.unique_id.empty() ? "none" : full_status.unique_id); |
533 sync_ui_util::AddBoolSyncDetail(details, | 526 sync_ui_util::AddBoolSyncDetail(details, |
534 "Server Up", | |
535 full_status.server_up); | |
536 sync_ui_util::AddBoolSyncDetail(details, | |
537 "Server Reachable", | |
538 full_status.server_reachable); | |
539 sync_ui_util::AddBoolSyncDetail(details, | |
540 "Notifications Enabled", | 527 "Notifications Enabled", |
541 full_status.notifications_enabled); | 528 full_status.notifications_enabled); |
542 sync_ui_util::AddIntSyncDetail(details, | 529 sync_ui_util::AddIntSyncDetail(details, |
543 "Notifications Received", | 530 "Notifications Received", |
544 full_status.notifications_received); | 531 full_status.notifications_received); |
545 sync_ui_util::AddIntSyncDetail(details, | 532 sync_ui_util::AddIntSyncDetail(details, |
546 "Unsynced Count", | 533 "Unsynced Count", |
547 full_status.unsynced_count); | 534 full_status.unsynced_count); |
548 sync_ui_util::AddIntSyncDetail(details, | 535 sync_ui_util::AddIntSyncDetail(details, |
549 "Conflicting Count", | 536 "Conflicting Count", |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
700 } | 687 } |
701 } else { | 688 } else { |
702 version_modifier = " " + version_modifier; | 689 version_modifier = " " + version_modifier; |
703 } | 690 } |
704 return chrome_version.Name() + " " + chrome_version.OSType() + " " + | 691 return chrome_version.Name() + " " + chrome_version.OSType() + " " + |
705 chrome_version.Version() + " (" + chrome_version.LastChange() + ")" + | 692 chrome_version.Version() + " (" + chrome_version.LastChange() + ")" + |
706 version_modifier; | 693 version_modifier; |
707 } | 694 } |
708 | 695 |
709 } // namespace sync_ui_util | 696 } // namespace sync_ui_util |
OLD | NEW |