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 void FakeSyncService::SetEncryptionPassphrase(const std::string
& passphrase
,
116 PassphraseType type
) {
119 bool FakeSyncService::SetDecryptionPassphrase(const std::string
& passphrase
) {
123 bool FakeSyncService::IsCryptographerReady(
124 const syncer::BaseTransaction
* trans
) const {
128 syncer::UserShare
* FakeSyncService::GetUserShare() const {
129 return new syncer::UserShare();
132 bool FakeSyncService::IsPassphraseRequired() const {
136 syncer::ModelTypeSet
FakeSyncService::GetEncryptedDataTypes() const {
137 return syncer::ModelTypeSet();
140 } // namespace sync_driver