Roll src/third_party/WebKit 9f7fb92:f103b33 (svn 202621:202622)
[chromium-blink-merge.git] / components / sync_driver / fake_sync_service.cc
blob7f7c260c720b06b8099e73c94b36fe5b17229b87
1 // Copyright 2015 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.
5 #include "components/sync_driver/fake_sync_service.h"
7 #include "base/values.h"
8 #include "sync/internal_api/public/base_transaction.h"
9 #include "sync/internal_api/public/sessions/sync_session_snapshot.h"
10 #include "sync/internal_api/public/user_share.h"
12 namespace sync_driver {
14 FakeSyncService::FakeSyncService()
15 : error_(GoogleServiceAuthError::NONE),
16 user_share_(make_scoped_ptr(new syncer::UserShare())) {}
18 FakeSyncService::~FakeSyncService() {
21 bool FakeSyncService::HasSyncSetupCompleted() const {
22 return false;
25 bool FakeSyncService::IsSyncAllowed() const {
26 return false;
29 bool FakeSyncService::IsSyncActive() const {
30 return false;
33 syncer::ModelTypeSet FakeSyncService::GetActiveDataTypes() const {
34 return syncer::ModelTypeSet();
37 void FakeSyncService::AddObserver(SyncServiceObserver* observer) {
40 void FakeSyncService::RemoveObserver(SyncServiceObserver* observer) {
43 bool FakeSyncService::HasObserver(const SyncServiceObserver* observer) const {
44 return false;
47 bool FakeSyncService::CanSyncStart() const {
48 return false;
51 void FakeSyncService::OnDataTypeRequestsSyncStartup(syncer::ModelType type) {
54 void FakeSyncService::RequestStop(
55 sync_driver::SyncService::SyncStopDataFate data_fate) {
58 void FakeSyncService::RequestStart() {
61 syncer::ModelTypeSet FakeSyncService::GetPreferredDataTypes() const {
62 return syncer::ModelTypeSet();
65 void FakeSyncService::OnUserChoseDatatypes(bool sync_everything,
66 syncer::ModelTypeSet chosen_types) {
69 void FakeSyncService::SetSyncSetupCompleted() {
72 bool FakeSyncService::IsFirstSetupInProgress() const {
73 return false;
76 void FakeSyncService::SetSetupInProgress(bool setup_in_progress) {
79 bool FakeSyncService::IsSetupInProgress() const {
80 return false;
83 bool FakeSyncService::ConfigurationDone() const {
84 return false;
87 const GoogleServiceAuthError& FakeSyncService::GetAuthError() const {
88 return error_;
91 bool FakeSyncService::HasUnrecoverableError() const {
92 return false;
95 bool FakeSyncService::IsBackendInitialized() const {
96 return false;
99 OpenTabsUIDelegate* FakeSyncService::GetOpenTabsUIDelegate() {
100 return nullptr;
103 bool FakeSyncService::IsPassphraseRequiredForDecryption() const {
104 return false;
107 base::Time FakeSyncService::GetExplicitPassphraseTime() const {
108 return base::Time();
111 bool FakeSyncService::IsUsingSecondaryPassphrase() const {
112 return false;
115 void FakeSyncService::EnableEncryptEverything() {
118 bool FakeSyncService::IsEncryptEverythingEnabled() const {
119 return false;
122 void FakeSyncService::SetEncryptionPassphrase(const std::string& passphrase,
123 PassphraseType type) {
126 bool FakeSyncService::SetDecryptionPassphrase(const std::string& passphrase) {
127 return false;
130 bool FakeSyncService::IsCryptographerReady(
131 const syncer::BaseTransaction* trans) const {
132 return false;
135 syncer::UserShare* FakeSyncService::GetUserShare() const {
136 return user_share_.get();
139 LocalDeviceInfoProvider* FakeSyncService::GetLocalDeviceInfoProvider() const {
140 return nullptr;
143 void FakeSyncService::RegisterDataTypeController(
144 sync_driver::DataTypeController* data_type_controller) {
147 void FakeSyncService::ReenableDatatype(syncer::ModelType type) {}
149 void FakeSyncService::DeactivateDataType(syncer::ModelType type) {}
151 bool FakeSyncService::IsPassphraseRequired() const {
152 return false;
155 syncer::ModelTypeSet FakeSyncService::GetEncryptedDataTypes() const {
156 return syncer::ModelTypeSet();
159 FakeSyncService::SyncTokenStatus FakeSyncService::GetSyncTokenStatus() const {
160 return FakeSyncService::SyncTokenStatus();
163 std::string FakeSyncService::QuerySyncStatusSummaryString() {
164 return "";
167 bool FakeSyncService::QueryDetailedSyncStatus(syncer::SyncStatus* result) {
168 return false;
171 base::string16 FakeSyncService::GetLastSyncedTimeString() const {
172 return base::string16();
175 std::string FakeSyncService::GetBackendInitializationStateString() const {
176 return std::string();
179 syncer::sessions::SyncSessionSnapshot FakeSyncService::GetLastSessionSnapshot()
180 const {
181 return syncer::sessions::SyncSessionSnapshot();
184 base::Value* FakeSyncService::GetTypeStatusMap() const {
185 return new base::ListValue();
188 const GURL& FakeSyncService::sync_service_url() const {
189 return sync_service_url_;
192 std::string FakeSyncService::unrecoverable_error_message() const {
193 return unrecoverable_error_message_;
196 tracked_objects::Location FakeSyncService::unrecoverable_error_location()
197 const {
198 return tracked_objects::Location();
201 } // namespace sync_driver