| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 delegate_->IsSyncingCurrentlySilenced(), | 53 delegate_->IsSyncingCurrentlySilenced(), |
| 54 status_controller_->unsynced_handles().size(), | 54 status_controller_->unsynced_handles().size(), |
| 55 status_controller_->TotalNumConflictingItems(), | 55 status_controller_->TotalNumConflictingItems(), |
| 56 status_controller_->did_commit_items()); | 56 status_controller_->did_commit_items()); |
| 57 } | 57 } |
| 58 | 58 |
| 59 SyncSourceInfo SyncSession::TestAndSetSource() { | 59 SyncSourceInfo SyncSession::TestAndSetSource() { |
| 60 SyncSourceInfo old_source = source_; | 60 SyncSourceInfo old_source = source_; |
| 61 source_ = SyncSourceInfo( | 61 source_ = SyncSourceInfo( |
| 62 sync_pb::GetUpdatesCallerInfo::SYNC_CYCLE_CONTINUATION, | 62 sync_pb::GetUpdatesCallerInfo::SYNC_CYCLE_CONTINUATION, |
| 63 source_.second); | 63 source_.types(), |
| 64 source_.payloads()); |
| 64 return old_source; | 65 return old_source; |
| 65 } | 66 } |
| 66 | 67 |
| 67 bool SyncSession::HasMoreToSync() const { | 68 bool SyncSession::HasMoreToSync() const { |
| 68 const StatusController* status = status_controller_.get(); | 69 const StatusController* status = status_controller_.get(); |
| 69 return ((status->commit_ids().size() < status->unsynced_handles().size()) && | 70 return ((status->commit_ids().size() < status->unsynced_handles().size()) && |
| 70 status->syncer_status().num_successful_commits > 0) || | 71 status->syncer_status().num_successful_commits > 0) || |
| 71 status->conflict_sets_built() || | 72 status->conflict_sets_built() || |
| 72 status->conflicts_resolved(); | 73 status->conflicts_resolved(); |
| 73 // Or, we have conflicting updates, but we're making progress on | 74 // Or, we have conflicting updates, but we're making progress on |
| 74 // resolving them... | 75 // resolving them... |
| 75 } | 76 } |
| 76 | 77 |
| 77 } // namespace sessions | 78 } // namespace sessions |
| 78 } // namespace browser_sync | 79 } // namespace browser_sync |
| OLD | NEW |