Home | History | Annotate | Download | only in engine
      1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #include "chrome/browser/sync/engine/resolve_conflicts_command.h"
      6 
      7 #include "chrome/browser/sync/engine/conflict_resolver.h"
      8 #include "chrome/browser/sync/sessions/sync_session.h"
      9 #include "chrome/browser/sync/syncable/directory_manager.h"
     10 
     11 namespace browser_sync {
     12 
     13 ResolveConflictsCommand::ResolveConflictsCommand() {}
     14 ResolveConflictsCommand::~ResolveConflictsCommand() {}
     15 
     16 void ResolveConflictsCommand::ModelChangingExecuteImpl(
     17     sessions::SyncSession* session) {
     18   ConflictResolver* resolver = session->context()->resolver();
     19   DCHECK(resolver);
     20   if (!resolver)
     21     return;
     22 
     23   syncable::ScopedDirLookup dir(session->context()->directory_manager(),
     24                                 session->context()->account_name());
     25   if (!dir.good())
     26     return;
     27   sessions::StatusController* status = session->status_controller();
     28   status->update_conflicts_resolved(resolver->ResolveConflicts(dir, status));
     29 }
     30 
     31 }  // namespace browser_sync
     32