Index: chrome/browser/sync/engine/model_changing_syncer_command.cc |
diff --git a/chrome/browser/sync/engine/model_changing_syncer_command.cc b/chrome/browser/sync/engine/model_changing_syncer_command.cc |
index a8df65ade9e3eb0795ef41c8bc0de775e5e136d4..a4aa26e15bda636f46c412fb76e948a5128411ac 100644 |
--- a/chrome/browser/sync/engine/model_changing_syncer_command.cc |
+++ b/chrome/browser/sync/engine/model_changing_syncer_command.cc |
@@ -6,7 +6,6 @@ |
#include "base/basictypes.h" |
#include "base/callback_old.h" |
-#include "chrome/browser/sync/engine/model_safe_worker.h" |
#include "chrome/browser/sync/sessions/status_controller.h" |
#include "chrome/browser/sync/sessions/sync_session.h" |
#include "chrome/browser/sync/util/unrecoverable_error_info.h" |
@@ -19,27 +18,15 @@ void ModelChangingSyncerCommand::ExecuteImpl(sessions::SyncSession* session) { |
return; |
} |
- // Project the list of active types (i.e., types in the routing |
- // info) to a list of groups. |
- // |
- // TODO(akalin): Make this overrideable by subclasses (who might be |
- // working on a subset of |active_groups|). (See |
- // http://crbug.com/97832.) |
- std::set<ModelSafeGroup> active_groups; |
- const ModelSafeRoutingInfo& routing_info = session->routing_info(); |
- for (ModelSafeRoutingInfo::const_iterator it = routing_info.begin(); |
- it != routing_info.end(); ++it) { |
- active_groups.insert(it->second); |
- } |
- // Always work on GROUP_PASSIVE, since that's the group that |
- // top-level folders map to. |
- active_groups.insert(GROUP_PASSIVE); |
- |
+ const std::set<ModelSafeGroup>& groups_to_change = |
+ HasCustomGroupsToChange() ? |
+ GetGroupsToChange(*work_session_) : |
+ session->GetEnabledGroups(); |
for (size_t i = 0; i < session->workers().size(); ++i) { |
- ModelSafeWorker* worker = session->workers()[i]; |
+ ModelSafeWorker* worker = work_session_->workers()[i]; |
ModelSafeGroup group = worker->GetModelSafeGroup(); |
// Skip workers whose group isn't active. |
- if (active_groups.find(group) == active_groups.end()) { |
+ if (groups_to_change.count(group) == 0u) { |
DVLOG(2) << "Skipping worker for group " |
<< ModelSafeGroupToString(group); |
continue; |