Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(303)

Side by Side Diff: components/sync/driver/glue/sync_backend_host_mock.cc

Issue 2533083002: [Sync] SyncEngine refactor part 1: interfaces. (Closed)
Patch Set: Rebase. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2013 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/glue/sync_backend_host_mock.h"
6
7 #include "components/sync/driver/sync_frontend.h"
8 #include "components/sync/engine/activation_context.h"
9
10 namespace syncer {
11
12 const char kTestCacheGuid[] = "test-guid";
13
14 SyncBackendHostMock::SyncBackendHostMock() : fail_initial_download_(false) {}
15 SyncBackendHostMock::~SyncBackendHostMock() {}
16
17 void SyncBackendHostMock::Initialize(
18 SyncFrontend* frontend,
19 scoped_refptr<base::SingleThreadTaskRunner> sync_task_runner,
20 const WeakHandle<JsEventHandler>& event_handler,
21 const GURL& service_url,
22 const std::string& sync_user_agent,
23 const SyncCredentials& credentials,
24 bool delete_sync_data_folder,
25 bool enable_local_sync_backend,
26 const base::FilePath& local_sync_backend_folder,
27 std::unique_ptr<SyncManagerFactory> sync_manager_factory,
28 const WeakHandle<UnrecoverableErrorHandler>& unrecoverable_error_handler,
29 const base::Closure& report_unrecoverable_error_function,
30 const HttpPostProviderFactoryGetter& http_post_provider_factory_getter,
31 std::unique_ptr<SyncEncryptionHandler::NigoriState> saved_nigori_state) {
32 frontend->OnBackendInitialized(WeakHandle<JsBackend>(),
33 WeakHandle<DataTypeDebugInfoListener>(),
34 kTestCacheGuid, !fail_initial_download_);
35 }
36
37 void SyncBackendHostMock::TriggerRefresh(const ModelTypeSet& types) {}
38
39 void SyncBackendHostMock::UpdateCredentials(
40 const SyncCredentials& credentials) {}
41
42 void SyncBackendHostMock::StartSyncingWithServer() {}
43
44 void SyncBackendHostMock::SetEncryptionPassphrase(const std::string& passphrase,
45 bool is_explicit) {}
46
47 bool SyncBackendHostMock::SetDecryptionPassphrase(
48 const std::string& passphrase) {
49 return false;
50 }
51
52 void SyncBackendHostMock::StopSyncingForShutdown() {}
53
54 void SyncBackendHostMock::Shutdown(ShutdownReason reason) {}
55
56 void SyncBackendHostMock::UnregisterInvalidationIds() {}
57
58 ModelTypeSet SyncBackendHostMock::ConfigureDataTypes(
59 ConfigureReason reason,
60 const DataTypeConfigStateMap& config_state_map,
61 const base::Callback<void(ModelTypeSet, ModelTypeSet)>& ready_task,
62 const base::Callback<void()>& retry_callback) {
63 return ModelTypeSet();
64 }
65
66 void SyncBackendHostMock::EnableEncryptEverything() {}
67
68 void SyncBackendHostMock::ActivateDirectoryDataType(
69 ModelType type,
70 ModelSafeGroup group,
71 ChangeProcessor* change_processor) {}
72 void SyncBackendHostMock::DeactivateDirectoryDataType(ModelType type) {}
73
74 void SyncBackendHostMock::ActivateNonBlockingDataType(
75 ModelType type,
76 std::unique_ptr<ActivationContext> activation_context) {}
77
78 void SyncBackendHostMock::DeactivateNonBlockingDataType(ModelType type) {}
79
80 UserShare* SyncBackendHostMock::GetUserShare() const {
81 return nullptr;
82 }
83
84 SyncBackendHost::Status SyncBackendHostMock::GetDetailedStatus() {
85 return SyncBackendHost::Status();
86 }
87
88 SyncCycleSnapshot SyncBackendHostMock::GetLastCycleSnapshot() const {
89 return SyncCycleSnapshot();
90 }
91
92 bool SyncBackendHostMock::HasUnsyncedItems() const {
93 return false;
94 }
95
96 bool SyncBackendHostMock::IsNigoriEnabled() const {
97 return true;
98 }
99
100 PassphraseType SyncBackendHostMock::GetPassphraseType() const {
101 return PassphraseType::IMPLICIT_PASSPHRASE;
102 }
103
104 base::Time SyncBackendHostMock::GetExplicitPassphraseTime() const {
105 return base::Time();
106 }
107
108 bool SyncBackendHostMock::IsCryptographerReady(
109 const BaseTransaction* trans) const {
110 return false;
111 }
112
113 void SyncBackendHostMock::GetModelSafeRoutingInfo(
114 ModelSafeRoutingInfo* out) const {}
115
116 void SyncBackendHostMock::FlushDirectory() const {}
117
118 void SyncBackendHostMock::RefreshTypesForTest(ModelTypeSet types) {}
119
120 void SyncBackendHostMock::RequestBufferedProtocolEventsAndEnableForwarding() {}
121
122 void SyncBackendHostMock::DisableProtocolEventForwarding() {}
123
124 void SyncBackendHostMock::EnableDirectoryTypeDebugInfoForwarding() {}
125
126 void SyncBackendHostMock::DisableDirectoryTypeDebugInfoForwarding() {}
127
128 void SyncBackendHostMock::set_fail_initial_download(bool should_fail) {
129 fail_initial_download_ = should_fail;
130 }
131
132 void SyncBackendHostMock::ClearServerData(
133 const SyncManager::ClearServerDataCallback& callback) {
134 callback.Run();
135 }
136
137 void SyncBackendHostMock::OnCookieJarChanged(bool account_mismatch,
138 bool empty_jar) {}
139
140 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/driver/glue/sync_backend_host_mock.h ('k') | components/sync/driver/model_association_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698