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

Unified Diff: chrome/browser/sync/engine/all_status.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: For review. Created 8 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/engine/all_status.cc
diff --git a/chrome/browser/sync/engine/all_status.cc b/chrome/browser/sync/engine/all_status.cc
index 374c0d35a42050e0c8944af7675a2aae7e400956..f302488ab64b824d75134ef583f67d1897aedaa5 100644
--- a/chrome/browser/sync/engine/all_status.cc
+++ b/chrome/browser/sync/engine/all_status.cc
@@ -17,7 +17,7 @@
namespace browser_sync {
AllStatus::AllStatus() {
- status_.summary = sync_api::SyncManager::Status::OFFLINE;
+ status_.summary = sync_api::SyncManager::Status::UNINITIALIZED;
status_.initial_sync_ended = true;
status_.notifications_enabled = false;
status_.cryptographer_ready = false;
@@ -69,6 +69,7 @@ sync_api::SyncManager::Status AllStatus::CalcSyncing(
// TODO(ncarter): Make this realtime by having the syncer_status
// counter preserve its value across sessions. http://crbug.com/26339
if (event.what_happened == SyncEngineEvent::SYNC_CYCLE_ENDED) {
+ ++status.sync_count;
status.updates_received +=
snapshot->syncer_status.num_updates_downloaded_total;
status.tombstone_updates_received +=
@@ -94,19 +95,19 @@ sync_api::SyncManager::Status AllStatus::CalcSyncing(
void AllStatus::CalcStatusChanges() {
const bool unsynced_changes = status_.unsynced_count > 0;
- const bool online = status_.authenticated &&
+ const bool online = status_.sync_count > 0 && status_.authenticated &&
status_.server_reachable && status_.server_up;
if (online) {
if (status_.syncing)
status_.summary = sync_api::SyncManager::Status::SYNCING;
else
status_.summary = sync_api::SyncManager::Status::READY;
- } else if (!status_.initial_sync_ended) {
- status_.summary = sync_api::SyncManager::Status::OFFLINE_UNUSABLE;
} else if (unsynced_changes) {
status_.summary = sync_api::SyncManager::Status::OFFLINE_UNSYNCED;
- } else {
+ } else if (status_.sync_count > 0) {
status_.summary = sync_api::SyncManager::Status::OFFLINE;
+ } else {
+ status_.summary = sync_api::SyncManager::Status::UNINITIALIZED;
}
}

Powered by Google App Engine
This is Rietveld 408576698