blob: e9b87326ffa8afd9730f669b2708de1537a47b80 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/sync_driver/proxy_data_type_controller.h"
namespace sync_driver {
ProxyDataTypeController::ProxyDataTypeController(
scoped_refptr<base::SingleThreadTaskRunner> ui_thread,
syncer::ModelType type)
: DataTypeController(ui_thread, base::Closure()),
state_(NOT_RUNNING),
type_(type) {
DCHECK(syncer::ProxyTypes().Has(type_));
}
ProxyDataTypeController::~ProxyDataTypeController() {
}
void ProxyDataTypeController::LoadModels(
const ModelLoadCallback& model_load_callback) {
state_ = MODEL_LOADED;
model_load_callback.Run(type(), syncer::SyncError());
}
void ProxyDataTypeController::StartAssociating(
const StartCallback& start_callback) {
syncer::SyncMergeResult local_merge_result(type_);
syncer::SyncMergeResult syncer_merge_result(type_);
state_ = RUNNING;
start_callback.Run(DataTypeController::OK,
local_merge_result,
syncer_merge_result);
}
void ProxyDataTypeController::Stop() {
state_ = NOT_RUNNING;
}
syncer::ModelType ProxyDataTypeController::type() const {
DCHECK(syncer::ProxyTypes().Has(type_));
return type_;
}
syncer::ModelSafeGroup ProxyDataTypeController::model_safe_group() const {
DCHECK(syncer::ProxyTypes().Has(type_));
return syncer::GROUP_PASSIVE;
}
ChangeProcessor* ProxyDataTypeController::GetChangeProcessor() const {
return NULL;
}
std::string ProxyDataTypeController::name() const {
// For logging only.
return syncer::ModelTypeToString(type());
}
DataTypeController::State ProxyDataTypeController::state() const {
return state_;
}
void ProxyDataTypeController::OnSingleDataTypeUnrecoverableError(
const syncer::SyncError& error) {
NOTIMPLEMENTED();
}
void ProxyDataTypeController::OnModelLoaded() {
NOTIMPLEMENTED();
}
} // namespace sync_driver
|