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/verify_updates_command.h" | 5 #include "chrome/browser/sync/engine/verify_updates_command.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "chrome/browser/sync/engine/syncer.h" | 10 #include "chrome/browser/sync/engine/syncer.h" |
11 #include "chrome/browser/sync/engine/syncer_proto_util.h" | 11 #include "chrome/browser/sync/engine/syncer_proto_util.h" |
12 #include "chrome/browser/sync/engine/syncer_types.h" | 12 #include "chrome/browser/sync/engine/syncer_types.h" |
13 #include "chrome/browser/sync/engine/syncer_util.h" | 13 #include "chrome/browser/sync/engine/syncer_util.h" |
14 #include "chrome/browser/sync/engine/syncproto.h" | 14 #include "chrome/browser/sync/engine/syncproto.h" |
15 #include "chrome/browser/sync/protocol/bookmark_specifics.pb.h" | 15 #include "chrome/browser/sync/protocol/bookmark_specifics.pb.h" |
16 #include "chrome/browser/sync/syncable/directory_manager.h" | 16 #include "chrome/browser/sync/syncable/directory_manager.h" |
17 #include "chrome/browser/sync/syncable/syncable.h" | 17 #include "chrome/browser/sync/syncable/syncable.h" |
18 | 18 |
19 namespace browser_sync { | 19 namespace browser_sync { |
20 | 20 |
21 using syncable::ScopedDirLookup; | 21 using syncable::ScopedDirLookup; |
22 using syncable::WriteTransaction; | 22 using syncable::WriteTransaction; |
23 | 23 |
24 using syncable::GET_BY_ID; | 24 using syncable::GET_BY_ID; |
25 using syncable::SYNCER; | 25 using syncable::SYNCER; |
26 | 26 |
27 VerifyUpdatesCommand::VerifyUpdatesCommand() {} | 27 VerifyUpdatesCommand::VerifyUpdatesCommand() {} |
28 VerifyUpdatesCommand::~VerifyUpdatesCommand() {} | 28 VerifyUpdatesCommand::~VerifyUpdatesCommand() {} |
29 | 29 |
30 bool VerifyUpdatesCommand::HasCustomGroupsToChange() const { | |
31 return true; | |
32 } | |
33 | |
34 std::set<ModelSafeGroup> VerifyUpdatesCommand::GetGroupsToChange( | 30 std::set<ModelSafeGroup> VerifyUpdatesCommand::GetGroupsToChange( |
35 const sessions::SyncSession& session) const { | 31 const sessions::SyncSession& session) const { |
36 std::set<ModelSafeGroup> groups_with_updates; | 32 std::set<ModelSafeGroup> groups_with_updates; |
37 | 33 |
38 const GetUpdatesResponse& updates = | 34 const GetUpdatesResponse& updates = |
39 session.status_controller().updates_response().get_updates(); | 35 session.status_controller().updates_response().get_updates(); |
40 for (int i = 0; i < updates.entries().size(); i++) { | 36 for (int i = 0; i < updates.entries().size(); i++) { |
41 groups_with_updates.insert( | 37 groups_with_updates.insert( |
42 GetGroupForModelType(syncable::GetModelType(updates.entries(i)), | 38 GetGroupForModelType(syncable::GetModelType(updates.entries(i)), |
43 session.routing_info())); | 39 session.routing_info())); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 deleted, is_directory, model_type); | 135 deleted, is_directory, model_type); |
140 } | 136 } |
141 | 137 |
142 if (VERIFY_UNDECIDED == result.value) | 138 if (VERIFY_UNDECIDED == result.value) |
143 result.value = VERIFY_SUCCESS; // No news is good news. | 139 result.value = VERIFY_SUCCESS; // No news is good news. |
144 | 140 |
145 return result; // This might be VERIFY_SUCCESS as well | 141 return result; // This might be VERIFY_SUCCESS as well |
146 } | 142 } |
147 | 143 |
148 } // namespace browser_sync | 144 } // namespace browser_sync |
OLD | NEW |