| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_SYNC_DRIVER_FAKE_SYNC_SERVICE_H_ | 5 #ifndef COMPONENTS_SYNC_DRIVER_FAKE_SYNC_SERVICE_H_ |
| 6 #define COMPONENTS_SYNC_DRIVER_FAKE_SYNC_SERVICE_H_ | 6 #define COMPONENTS_SYNC_DRIVER_FAKE_SYNC_SERVICE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "components/sync/driver/sync_service.h" | 11 #include "components/sync/driver/sync_service.h" |
| 12 #include "components/sync/engine/cycle/sync_cycle_snapshot.h" | 12 #include "components/sync/engine/cycle/sync_cycle_snapshot.h" |
| 13 #include "google_apis/gaia/google_service_auth_error.h" | 13 #include "google_apis/gaia/google_service_auth_error.h" |
| 14 | 14 |
| 15 namespace syncer { | 15 namespace syncer { |
| 16 | 16 |
| 17 class BaseTransaction; | 17 class BaseTransaction; |
| 18 struct UserShare; | 18 struct UserShare; |
| 19 | 19 |
| 20 // Fake implementation of SyncService, used for testing. | 20 // Fake implementation of SyncService, used for testing. |
| 21 class FakeSyncService : public SyncService { | 21 class FakeSyncService : public SyncService { |
| 22 public: | 22 public: |
| 23 FakeSyncService(); | 23 FakeSyncService(); |
| 24 ~FakeSyncService() override; | 24 ~FakeSyncService() override; |
| 25 | 25 |
| 26 private: | 26 private: |
| 27 // SyncService: | 27 // SyncService implementation. |
| 28 bool IsFirstSetupComplete() const override; | 28 bool IsFirstSetupComplete() const override; |
| 29 bool IsSyncAllowed() const override; | 29 bool IsSyncAllowed() const override; |
| 30 bool IsSyncActive() const override; | 30 bool IsSyncActive() const override; |
| 31 bool IsLocalSyncEnabled() const override; | 31 bool IsLocalSyncEnabled() const override; |
| 32 void TriggerRefresh(const ModelTypeSet& types) override; | 32 void TriggerRefresh(const ModelTypeSet& types) override; |
| 33 ModelTypeSet GetActiveDataTypes() const override; | 33 ModelTypeSet GetActiveDataTypes() const override; |
| 34 SyncClient* GetSyncClient() const override; | 34 SyncClient* GetSyncClient() const override; |
| 35 void AddObserver(SyncServiceObserver* observer) override; | 35 void AddObserver(SyncServiceObserver* observer) override; |
| 36 void RemoveObserver(SyncServiceObserver* observer) override; | 36 void RemoveObserver(SyncServiceObserver* observer) override; |
| 37 bool HasObserver(const SyncServiceObserver* observer) const override; | 37 bool HasObserver(const SyncServiceObserver* observer) const override; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 tracked_objects::Location unrecoverable_error_location() const override; | 78 tracked_objects::Location unrecoverable_error_location() const override; |
| 79 void AddProtocolEventObserver(ProtocolEventObserver* observer) override; | 79 void AddProtocolEventObserver(ProtocolEventObserver* observer) override; |
| 80 void RemoveProtocolEventObserver(ProtocolEventObserver* observer) override; | 80 void RemoveProtocolEventObserver(ProtocolEventObserver* observer) override; |
| 81 void AddTypeDebugInfoObserver(TypeDebugInfoObserver* observer) override; | 81 void AddTypeDebugInfoObserver(TypeDebugInfoObserver* observer) override; |
| 82 void RemoveTypeDebugInfoObserver(TypeDebugInfoObserver* observer) override; | 82 void RemoveTypeDebugInfoObserver(TypeDebugInfoObserver* observer) override; |
| 83 base::WeakPtr<JsController> GetJsController() override; | 83 base::WeakPtr<JsController> GetJsController() override; |
| 84 void GetAllNodes(const base::Callback<void(std::unique_ptr<base::ListValue>)>& | 84 void GetAllNodes(const base::Callback<void(std::unique_ptr<base::ListValue>)>& |
| 85 callback) override; | 85 callback) override; |
| 86 SigninManagerBase* signin() const override; | 86 SigninManagerBase* signin() const override; |
| 87 | 87 |
| 88 // DataTypeEncryptionHandler: | 88 // DataTypeEncryptionHandler implementation. |
| 89 bool IsPassphraseRequired() const override; | 89 bool IsPassphraseRequired() const override; |
| 90 ModelTypeSet GetEncryptedDataTypes() const override; | 90 ModelTypeSet GetEncryptedDataTypes() const override; |
| 91 | 91 |
| 92 // KeyedService implementation. |
| 93 void Shutdown() override; |
| 94 |
| 92 GoogleServiceAuthError error_; | 95 GoogleServiceAuthError error_; |
| 93 GURL sync_service_url_; | 96 GURL sync_service_url_; |
| 94 std::string unrecoverable_error_message_; | 97 std::string unrecoverable_error_message_; |
| 95 std::unique_ptr<UserShare> user_share_; | 98 std::unique_ptr<UserShare> user_share_; |
| 96 }; | 99 }; |
| 97 | 100 |
| 98 } // namespace syncer | 101 } // namespace syncer |
| 99 | 102 |
| 100 #endif // COMPONENTS_SYNC_DRIVER_FAKE_SYNC_SERVICE_H_ | 103 #endif // COMPONENTS_SYNC_DRIVER_FAKE_SYNC_SERVICE_H_ |
| OLD | NEW |