Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Side by Side Diff: chrome/browser/sync/sync_ui_util.cc

Issue 9323015: [Sync] - In about:sync page display if the first sync after restart has taken place or not. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 if (!service) { 503 if (!service) {
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 if (full_status.summary == sync_api::SyncManager::Status::UNININITIALIZED) {
rlarocque 2012/02/02 22:44:13 I'm not sure this is a good idea. What is the p
lipalani1 2012/02/03 01:55:39 Answer in the previous comment. On 2012/02/02 22:4
rlarocque 2012/02/03 18:55:03 I still think this is unusual. We have plenty o
514 strings->Set("summary_explanation_needed",
515 new base::FundamentalValue(true));
516 std::string message = "A sync has not happened since restart. ";
517 message += "The following values are speculative.";
518 strings->SetString("summary_explanation_message", message);
519 }
513 520
514 strings->SetString("version", GetVersionString()); 521 strings->SetString("version", GetVersionString());
515 strings->Set("authenticated", 522 strings->Set("authenticated",
516 new base::FundamentalValue(full_status.authenticated)); 523 new base::FundamentalValue(full_status.authenticated));
517 strings->SetString("auth_problem", 524 strings->SetString("auth_problem",
518 sync_ui_util::MakeSyncAuthErrorText( 525 sync_ui_util::MakeSyncAuthErrorText(
519 service->GetAuthError().state())); 526 service->GetAuthError().state()));
520 527
521 strings->SetString("time_since_sync", service->GetLastSyncedTimeString()); 528 strings->SetString("time_since_sync", service->GetLastSyncedTimeString());
522 529
(...skipping 30 matching lines...) Expand all
553 full_status.conflicting_count); 560 full_status.conflicting_count);
554 sync_ui_util::AddIntSyncDetail(details, 561 sync_ui_util::AddIntSyncDetail(details,
555 "Local Overwrites", 562 "Local Overwrites",
556 full_status.num_local_overwrites_total); 563 full_status.num_local_overwrites_total);
557 sync_ui_util::AddIntSyncDetail(details, 564 sync_ui_util::AddIntSyncDetail(details,
558 "Server Overwrites", 565 "Server Overwrites",
559 full_status.num_server_overwrites_total); 566 full_status.num_server_overwrites_total);
560 sync_ui_util::AddBoolSyncDetail(details, "Syncing", full_status.syncing); 567 sync_ui_util::AddBoolSyncDetail(details, "Syncing", full_status.syncing);
561 sync_ui_util::AddBoolSyncDetail(details, 568 sync_ui_util::AddBoolSyncDetail(details,
562 "Initial Sync Ended", 569 "Initial Sync Ended",
563 full_status.initial_sync_ended); 570 full_status.sync_count > 0);
rlarocque 2012/02/02 22:44:13 That's not what initial_sync_ended used to mean.
lipalani1 2012/02/03 01:55:39 code reverted. I kind of don't like that piece of
564 sync_ui_util::AddIntSyncDetail(details, 571 sync_ui_util::AddIntSyncDetail(details,
565 "Updates Available", 572 "Updates Available",
566 full_status.updates_available); 573 full_status.updates_available);
567 sync_ui_util::AddIntSyncDetail(details, 574 sync_ui_util::AddIntSyncDetail(details,
568 "Updates Downloaded (All)", 575 "Updates Downloaded (All)",
569 full_status.updates_received); 576 full_status.updates_received);
570 sync_ui_util::AddIntSyncDetail(details, 577 sync_ui_util::AddIntSyncDetail(details,
571 "Updates Downloaded (Tombstones)", 578 "Updates Downloaded (Tombstones)",
572 full_status.tombstone_updates_received); 579 full_status.tombstone_updates_received);
573 sync_ui_util::AddIntSyncDetail(details, 580 sync_ui_util::AddIntSyncDetail(details,
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
697 } 704 }
698 } else { 705 } else {
699 version_modifier = " " + version_modifier; 706 version_modifier = " " + version_modifier;
700 } 707 }
701 return chrome_version.Name() + " " + chrome_version.OSType() + " " + 708 return chrome_version.Name() + " " + chrome_version.OSType() + " " +
702 chrome_version.Version() + " (" + chrome_version.LastChange() + ")" + 709 chrome_version.Version() + " (" + chrome_version.LastChange() + ")" +
703 version_modifier; 710 version_modifier;
704 } 711 }
705 712
706 } // namespace sync_ui_util 713 } // namespace sync_ui_util
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698