| 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/engine/apply_updates_command.h" | 5 #include "chrome/browser/sync/engine/apply_updates_command.h" |
| 6 | 6 |
| 7 #include "base/location.h" | 7 #include "base/location.h" |
| 8 #include "chrome/browser/sync/engine/update_applicator.h" | 8 #include "chrome/browser/sync/engine/update_applicator.h" |
| 9 #include "chrome/browser/sync/sessions/sync_session.h" | 9 #include "chrome/browser/sync/sessions/sync_session.h" |
| 10 #include "chrome/browser/sync/syncable/directory_manager.h" | 10 #include "chrome/browser/sync/syncable/directory_manager.h" |
| 11 #include "chrome/browser/sync/syncable/syncable.h" | 11 #include "chrome/browser/sync/syncable/syncable.h" |
| 12 | 12 |
| 13 namespace browser_sync { | 13 namespace browser_sync { |
| 14 | 14 |
| 15 using sessions::SyncSession; | 15 using sessions::SyncSession; |
| 16 | 16 |
| 17 ApplyUpdatesCommand::ApplyUpdatesCommand() {} | 17 ApplyUpdatesCommand::ApplyUpdatesCommand() {} |
| 18 ApplyUpdatesCommand::~ApplyUpdatesCommand() {} | 18 ApplyUpdatesCommand::~ApplyUpdatesCommand() {} |
| 19 | 19 |
| 20 bool ApplyUpdatesCommand::HasCustomGroupsToChange() const { | |
| 21 return true; | |
| 22 } | |
| 23 | |
| 24 std::set<ModelSafeGroup> ApplyUpdatesCommand::GetGroupsToChange( | 20 std::set<ModelSafeGroup> ApplyUpdatesCommand::GetGroupsToChange( |
| 25 const sessions::SyncSession& session) const { | 21 const sessions::SyncSession& session) const { |
| 26 std::set<ModelSafeGroup> groups_with_unapplied_updates; | 22 std::set<ModelSafeGroup> groups_with_unapplied_updates; |
| 27 | 23 |
| 28 syncable::FullModelTypeSet server_types_with_unapplied_updates; | 24 syncable::FullModelTypeSet server_types_with_unapplied_updates; |
| 29 { | 25 { |
| 30 syncable::ScopedDirLookup dir(session.context()->directory_manager(), | 26 syncable::ScopedDirLookup dir(session.context()->directory_manager(), |
| 31 session.context()->account_name()); | 27 session.context()->account_name()); |
| 32 if (!dir.good()) { | 28 if (!dir.good()) { |
| 33 LOG(ERROR) << "Scoped dir lookup failed!"; | 29 LOG(ERROR) << "Scoped dir lookup failed!"; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 if (status.ServerSaysNothingMoreToDownload()) { | 87 if (status.ServerSaysNothingMoreToDownload()) { |
| 92 for (syncable::ModelTypeSet::Iterator it = | 88 for (syncable::ModelTypeSet::Iterator it = |
| 93 status.updates_request_types().First(); it.Good(); it.Inc()) { | 89 status.updates_request_types().First(); it.Good(); it.Inc()) { |
| 94 // This gets persisted to the directory's backing store. | 90 // This gets persisted to the directory's backing store. |
| 95 dir->set_initial_sync_ended_for_type(it.Get(), true); | 91 dir->set_initial_sync_ended_for_type(it.Get(), true); |
| 96 } | 92 } |
| 97 } | 93 } |
| 98 } | 94 } |
| 99 | 95 |
| 100 } // namespace browser_sync | 96 } // namespace browser_sync |
| OLD | NEW |