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 "sync/internal_api/public/base_transaction.h"
8 #include "sync/internal_api/public/user_share.h"
10 namespace sync_driver
{
12 FakeSyncService::FakeSyncService() : error_(GoogleServiceAuthError::NONE
) {
15 FakeSyncService::~FakeSyncService() {
18 bool FakeSyncService::HasSyncSetupCompleted() const {
22 bool FakeSyncService::IsSyncAllowed() const {
26 bool FakeSyncService::IsSyncActive() const {
30 syncer::ModelTypeSet
FakeSyncService::GetActiveDataTypes() const {
31 return syncer::ModelTypeSet();
34 void FakeSyncService::AddObserver(SyncServiceObserver
* observer
) {
37 void FakeSyncService::RemoveObserver(SyncServiceObserver
* observer
) {
40 bool FakeSyncService::HasObserver(const SyncServiceObserver
* observer
) const {
44 bool FakeSyncService::CanSyncStart() const {
48 void FakeSyncService::OnDataTypeRequestsSyncStartup(syncer::ModelType type
) {
51 void FakeSyncService::RequestStop(
52 sync_driver::SyncService::SyncStopDataFate data_fate
) {
55 void FakeSyncService::RequestStart() {
58 syncer::ModelTypeSet
FakeSyncService::GetPreferredDataTypes() const {
59 return syncer::ModelTypeSet();
62 void FakeSyncService::OnUserChoseDatatypes(bool sync_everything
,
63 syncer::ModelTypeSet chosen_types
) {
66 void FakeSyncService::SetSyncSetupCompleted() {
69 bool FakeSyncService::FirstSetupInProgress() const {
73 void FakeSyncService::SetSetupInProgress(bool setup_in_progress
) {
76 bool FakeSyncService::setup_in_progress() const {
80 bool FakeSyncService::ConfigurationDone() const {
84 const GoogleServiceAuthError
& FakeSyncService::GetAuthError() const {
88 bool FakeSyncService::HasUnrecoverableError() const {
92 bool FakeSyncService::backend_initialized() const {
96 OpenTabsUIDelegate
* FakeSyncService::GetOpenTabsUIDelegate() {
100 bool FakeSyncService::IsPassphraseRequiredForDecryption() const {
104 base::Time
FakeSyncService::GetExplicitPassphraseTime() const {
108 bool FakeSyncService::IsUsingSecondaryPassphrase() const {
112 void FakeSyncService::EnableEncryptEverything() {
115 bool FakeSyncService::EncryptEverythingEnabled() const {
119 void FakeSyncService::SetEncryptionPassphrase(const std::string
& passphrase
,
120 PassphraseType type
) {
123 bool FakeSyncService::SetDecryptionPassphrase(const std::string
& passphrase
) {
127 bool FakeSyncService::IsCryptographerReady(
128 const syncer::BaseTransaction
* trans
) const {
132 syncer::UserShare
* FakeSyncService::GetUserShare() const {
133 return new syncer::UserShare();
136 LocalDeviceInfoProvider
* FakeSyncService::GetLocalDeviceInfoProvider() const {
140 void FakeSyncService::RegisterDataTypeController(
141 sync_driver::DataTypeController
* data_type_controller
) {
144 void FakeSyncService::ReenableDatatype(syncer::ModelType type
) {}
146 void FakeSyncService::DeactivateDataType(syncer::ModelType type
) {}
148 bool FakeSyncService::IsPassphraseRequired() const {
152 syncer::ModelTypeSet
FakeSyncService::GetEncryptedDataTypes() const {
153 return syncer::ModelTypeSet();
156 } // namespace sync_driver