Upstream version 5.34.92.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / sync / glue / sync_backend_host_mock.cc
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 "chrome/browser/sync/glue/sync_backend_host_mock.h"
6
7 #include "chrome/browser/sync/glue/sync_frontend.h"
8
9 namespace browser_sync {
10
11 SyncBackendHostMock::SyncBackendHostMock() : fail_initial_download_(false) {}
12 SyncBackendHostMock::~SyncBackendHostMock() {}
13
14 void SyncBackendHostMock::Initialize(
15     SyncFrontend* frontend,
16     scoped_ptr<base::Thread> sync_thread,
17     const syncer::WeakHandle<syncer::JsEventHandler>& event_handler,
18     const GURL& service_url,
19     const syncer::SyncCredentials& credentials,
20     bool delete_sync_data_folder,
21     scoped_ptr<syncer::SyncManagerFactory> sync_manager_factory,
22     scoped_ptr<syncer::UnrecoverableErrorHandler> unrecoverable_error_handler,
23     syncer::ReportUnrecoverableErrorFunction
24         report_unrecoverable_error_function,
25     syncer::NetworkResources* network_resources) {
26   frontend->OnBackendInitialized(
27       syncer::WeakHandle<syncer::JsBackend>(),
28       syncer::WeakHandle<syncer::DataTypeDebugInfoListener>(),
29       !fail_initial_download_);
30 }
31
32 void SyncBackendHostMock::UpdateCredentials(
33     const syncer::SyncCredentials& credentials) {}
34
35 void SyncBackendHostMock::StartSyncingWithServer() {}
36
37 void SyncBackendHostMock::SetEncryptionPassphrase(
38     const std::string& passphrase,
39     bool is_explicit) {}
40
41 bool SyncBackendHostMock::SetDecryptionPassphrase(
42     const std::string& passphrase) {
43   return false;
44 }
45
46 void SyncBackendHostMock::StopSyncingForShutdown() {}
47
48 scoped_ptr<base::Thread> SyncBackendHostMock::Shutdown(ShutdownOption option) {
49   return scoped_ptr<base::Thread>();
50 }
51
52 void SyncBackendHostMock::UnregisterInvalidationIds() {}
53
54 void SyncBackendHostMock::ConfigureDataTypes(
55     syncer::ConfigureReason reason,
56     const DataTypeConfigStateMap& config_state_map,
57     const base::Callback<void(syncer::ModelTypeSet,
58                               syncer::ModelTypeSet)>& ready_task,
59     const base::Callback<void()>& retry_callback) {}
60
61 void SyncBackendHostMock::EnableEncryptEverything() {}
62
63 void SyncBackendHostMock::ActivateDataType(
64     syncer::ModelType type, syncer::ModelSafeGroup group,
65     ChangeProcessor* change_processor) {}
66 void SyncBackendHostMock::DeactivateDataType(syncer::ModelType type) {}
67
68 syncer::UserShare* SyncBackendHostMock::GetUserShare() const {
69   return NULL;
70 }
71
72 SyncBackendHost::Status SyncBackendHostMock::GetDetailedStatus() {
73   return SyncBackendHost::Status();
74 }
75
76 syncer::sessions::SyncSessionSnapshot
77     SyncBackendHostMock::GetLastSessionSnapshot() const {
78   return syncer::sessions::SyncSessionSnapshot();
79 }
80
81 bool SyncBackendHostMock::HasUnsyncedItems() const {
82   return false;
83 }
84
85 bool SyncBackendHostMock::IsNigoriEnabled() const {
86  return false;
87 }
88
89 syncer::PassphraseType SyncBackendHostMock::GetPassphraseType() const {
90   return syncer::IMPLICIT_PASSPHRASE;
91 }
92
93 base::Time SyncBackendHostMock::GetExplicitPassphraseTime() const {
94   return base::Time();
95 }
96
97 bool SyncBackendHostMock::IsCryptographerReady(
98     const syncer::BaseTransaction* trans) const {
99   return false;
100 }
101
102 void SyncBackendHostMock::GetModelSafeRoutingInfo(
103     syncer::ModelSafeRoutingInfo* out) const {}
104
105 SyncedDeviceTracker* SyncBackendHostMock::GetSyncedDeviceTracker() const {
106   return NULL;
107 }
108
109 base::MessageLoop* SyncBackendHostMock::GetSyncLoopForTesting() {
110   return NULL;
111 }
112
113 void SyncBackendHostMock::set_fail_initial_download(bool should_fail) {
114   fail_initial_download_ = should_fail;
115 }
116
117 }  // namespace browser_sync
118