| 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/sessions/sync_session.h" | 5 #include "chrome/browser/sync/sessions/sync_session.h" |
| 6 #include "chrome/browser/sync/syncable/directory_manager.h" | 6 #include "chrome/browser/sync/syncable/directory_manager.h" |
| 7 #include "chrome/browser/sync/syncable/model_type.h" | 7 #include "chrome/browser/sync/syncable/model_type.h" |
| 8 | 8 |
| 9 namespace browser_sync { | 9 namespace browser_sync { |
| 10 namespace sessions { | 10 namespace sessions { |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 status_controller_->num_server_changes_remaining(), | 108 status_controller_->num_server_changes_remaining(), |
| 109 is_share_useable, | 109 is_share_useable, |
| 110 initial_sync_ended, | 110 initial_sync_ended, |
| 111 download_progress_markers, | 111 download_progress_markers, |
| 112 HasMoreToSync(), | 112 HasMoreToSync(), |
| 113 delegate_->IsSyncingCurrentlySilenced(), | 113 delegate_->IsSyncingCurrentlySilenced(), |
| 114 status_controller_->unsynced_handles().size(), | 114 status_controller_->unsynced_handles().size(), |
| 115 status_controller_->TotalNumBlockingConflictingItems(), | 115 status_controller_->TotalNumBlockingConflictingItems(), |
| 116 status_controller_->TotalNumConflictingItems(), | 116 status_controller_->TotalNumConflictingItems(), |
| 117 status_controller_->did_commit_items(), | 117 status_controller_->did_commit_items(), |
| 118 source_); | 118 source_, |
| 119 dir->GetEntriesCount()); |
| 119 } | 120 } |
| 120 | 121 |
| 121 SyncSourceInfo SyncSession::TestAndSetSource() { | 122 SyncSourceInfo SyncSession::TestAndSetSource() { |
| 122 SyncSourceInfo old_source = source_; | 123 SyncSourceInfo old_source = source_; |
| 123 source_ = SyncSourceInfo( | 124 source_ = SyncSourceInfo( |
| 124 sync_pb::GetUpdatesCallerInfo::SYNC_CYCLE_CONTINUATION, | 125 sync_pb::GetUpdatesCallerInfo::SYNC_CYCLE_CONTINUATION, |
| 125 source_.types); | 126 source_.types); |
| 126 return old_source; | 127 return old_source; |
| 127 } | 128 } |
| 128 | 129 |
| 129 bool SyncSession::HasMoreToSync() const { | 130 bool SyncSession::HasMoreToSync() const { |
| 130 const StatusController* status = status_controller_.get(); | 131 const StatusController* status = status_controller_.get(); |
| 131 return ((status->commit_ids().size() < status->unsynced_handles().size()) && | 132 return ((status->commit_ids().size() < status->unsynced_handles().size()) && |
| 132 status->syncer_status().num_successful_commits > 0) || | 133 status->syncer_status().num_successful_commits > 0) || |
| 133 status->conflict_sets_built() || | 134 status->conflict_sets_built() || |
| 134 status->conflicts_resolved(); | 135 status->conflicts_resolved(); |
| 135 // Or, we have conflicting updates, but we're making progress on | 136 // Or, we have conflicting updates, but we're making progress on |
| 136 // resolving them... | 137 // resolving them... |
| 137 } | 138 } |
| 138 | 139 |
| 139 } // namespace sessions | 140 } // namespace sessions |
| 140 } // namespace browser_sync | 141 } // namespace browser_sync |
| OLD | NEW |