| 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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 strings->SetString("summary", "SYNC DISABLED"); | 504 strings->SetString("summary", "SYNC DISABLED"); |
| 505 } else { | 505 } else { |
| 506 sync_api::SyncManager::Status full_status( | 506 sync_api::SyncManager::Status full_status( |
| 507 service->QueryDetailedSyncStatus()); | 507 service->QueryDetailedSyncStatus()); |
| 508 | 508 |
| 509 strings->SetString("service_url", service->sync_service_url().spec()); | 509 strings->SetString("service_url", service->sync_service_url().spec()); |
| 510 strings->SetString("summary", | 510 strings->SetString("summary", |
| 511 ProfileSyncService::BuildSyncStatusSummaryText( | 511 ProfileSyncService::BuildSyncStatusSummaryText( |
| 512 full_status.summary)); | 512 full_status.summary)); |
| 513 | 513 |
| 514 if (full_status.summary == sync_api::SyncManager::Status::UNINITIALIZED) { |
| 515 strings->Set("summary_explanation_needed", |
| 516 new base::FundamentalValue(true)); |
| 517 std::string message = "A sync has not happened since restart. "; |
| 518 message += "The following values are speculative."; |
| 519 strings->SetString("summary_explanation_message", message); |
| 520 } |
| 521 |
| 514 strings->SetString("version", GetVersionString()); | 522 strings->SetString("version", GetVersionString()); |
| 515 strings->Set("authenticated", | 523 strings->Set("authenticated", |
| 516 new base::FundamentalValue(full_status.authenticated)); | 524 new base::FundamentalValue(full_status.authenticated)); |
| 517 strings->SetString("auth_problem", | 525 strings->SetString("auth_problem", |
| 518 sync_ui_util::MakeSyncAuthErrorText( | 526 sync_ui_util::MakeSyncAuthErrorText( |
| 519 service->GetAuthError().state())); | 527 service->GetAuthError().state())); |
| 520 | 528 |
| 521 strings->SetString("time_since_sync", service->GetLastSyncedTimeString()); | 529 strings->SetString("time_since_sync", service->GetLastSyncedTimeString()); |
| 522 | 530 |
| 523 ListValue* details = new ListValue(); | 531 ListValue* details = new ListValue(); |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 } | 705 } |
| 698 } else { | 706 } else { |
| 699 version_modifier = " " + version_modifier; | 707 version_modifier = " " + version_modifier; |
| 700 } | 708 } |
| 701 return chrome_version.Name() + " " + chrome_version.OSType() + " " + | 709 return chrome_version.Name() + " " + chrome_version.OSType() + " " + |
| 702 chrome_version.Version() + " (" + chrome_version.LastChange() + ")" + | 710 chrome_version.Version() + " (" + chrome_version.LastChange() + ")" + |
| 703 version_modifier; | 711 version_modifier; |
| 704 } | 712 } |
| 705 | 713 |
| 706 } // namespace sync_ui_util | 714 } // namespace sync_ui_util |
| OLD | NEW |