| 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/sessions/sync_session.h" | 5 #include "chrome/browser/sync/sessions/sync_session.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "chrome/browser/sync/syncable/directory_manager.h" | 10 #include "chrome/browser/sync/syncable/directory_manager.h" |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 source_ = SyncSourceInfo( | 182 source_ = SyncSourceInfo( |
| 183 sync_pb::GetUpdatesCallerInfo::SYNC_CYCLE_CONTINUATION, | 183 sync_pb::GetUpdatesCallerInfo::SYNC_CYCLE_CONTINUATION, |
| 184 source_.types); | 184 source_.types); |
| 185 return old_source; | 185 return old_source; |
| 186 } | 186 } |
| 187 | 187 |
| 188 bool SyncSession::HasMoreToSync() const { | 188 bool SyncSession::HasMoreToSync() const { |
| 189 const StatusController* status = status_controller_.get(); | 189 const StatusController* status = status_controller_.get(); |
| 190 return ((status->commit_ids().size() < status->unsynced_handles().size()) && | 190 return ((status->commit_ids().size() < status->unsynced_handles().size()) && |
| 191 status->syncer_status().num_successful_commits > 0) || | 191 status->syncer_status().num_successful_commits > 0) || |
| 192 status->conflict_sets_built() || | |
| 193 status->conflicts_resolved(); | 192 status->conflicts_resolved(); |
| 194 // Or, we have conflicting updates, but we're making progress on | 193 // Or, we have conflicting updates, but we're making progress on |
| 195 // resolving them... | 194 // resolving them... |
| 196 } | 195 } |
| 197 | 196 |
| 198 const std::set<ModelSafeGroup>& SyncSession::GetEnabledGroups() const { | 197 const std::set<ModelSafeGroup>& SyncSession::GetEnabledGroups() const { |
| 199 return enabled_groups_; | 198 return enabled_groups_; |
| 200 } | 199 } |
| 201 | 200 |
| 202 std::set<ModelSafeGroup> SyncSession::GetEnabledGroupsWithConflicts() const { | 201 std::set<ModelSafeGroup> SyncSession::GetEnabledGroupsWithConflicts() const { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 IsError(status_controller_->error().last_post_commit_result); | 250 IsError(status_controller_->error().last_post_commit_result); |
| 252 const bool process_commit_response_error = | 251 const bool process_commit_response_error = |
| 253 IsError(status_controller_->error().last_process_commit_response_result); | 252 IsError(status_controller_->error().last_process_commit_response_result); |
| 254 return !download_updates_error | 253 return !download_updates_error |
| 255 && !post_commit_error | 254 && !post_commit_error |
| 256 && !process_commit_response_error; | 255 && !process_commit_response_error; |
| 257 } | 256 } |
| 258 | 257 |
| 259 } // namespace sessions | 258 } // namespace sessions |
| 260 } // namespace browser_sync | 259 } // namespace browser_sync |
| OLD | NEW |