data_type_manager.cc revision 6d86b77056ed63eb6871182f42a9fd5f07550f90
1// Copyright 2014 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 "components/sync_driver/data_type_manager.h"
6
7namespace browser_sync {
8
9DataTypeManager::ConfigureResult::ConfigureResult()
10    : status(UNKNOWN) {
11}
12
13DataTypeManager::ConfigureResult::ConfigureResult(ConfigureStatus status,
14                                                  syncer::ModelTypeSet
15                                                      requested_types)
16    : status(status),
17      requested_types(requested_types) {
18  DCHECK_EQ(OK, status);
19}
20
21DataTypeManager::ConfigureResult::ConfigureResult(
22    ConfigureStatus status,
23    syncer::ModelTypeSet requested_types,
24    std::map<syncer::ModelType, syncer::SyncError> failed_data_types,
25    syncer::ModelTypeSet unfinished_data_types,
26    syncer::ModelTypeSet needs_crypto)
27    : status(status),
28      requested_types(requested_types),
29      failed_data_types(failed_data_types),
30      unfinished_data_types(unfinished_data_types),
31      needs_crypto(needs_crypto) {
32}
33
34DataTypeManager::ConfigureResult::~ConfigureResult() {
35}
36
37// Static.
38std::string DataTypeManager::ConfigureStatusToString(ConfigureStatus status) {
39  switch (status) {
40    case OK:
41      return "Ok";
42    case ABORTED:
43      return "Aborted";
44    case UNRECOVERABLE_ERROR:
45      return "Unrecoverable Error";
46    case PARTIAL_SUCCESS:
47      return "Partial Success";
48    default:
49      NOTREACHED();
50      return std::string();
51  }
52}
53
54}  // namespace browser_sync
55