| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2012 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 #ifndef SYNC_NOTIFIER_FAKE_SYNC_NOTIFIER_H_ | |
| 6 #define SYNC_NOTIFIER_FAKE_SYNC_NOTIFIER_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/compiler_specific.h" | |
| 11 #include "sync/notifier/invalidation_util.h" | |
| 12 #include "sync/notifier/sync_notifier.h" | |
| 13 #include "sync/notifier/sync_notifier_registrar.h" | |
| 14 | |
| 15 namespace syncer { | |
| 16 | |
| 17 class FakeSyncNotifier : public SyncNotifier { | |
| 18 public: | |
| 19 FakeSyncNotifier(); | |
| 20 virtual ~FakeSyncNotifier(); | |
| 21 | |
| 22 bool IsHandlerRegistered(SyncNotifierObserver* handler) const; | |
| 23 ObjectIdSet GetRegisteredIds(SyncNotifierObserver* handler) const; | |
| 24 const std::string& GetUniqueId() const; | |
| 25 const std::string& GetStateDeprecated() const; | |
| 26 const std::string& GetCredentialsEmail() const; | |
| 27 const std::string& GetCredentialsToken() const; | |
| 28 ModelTypeSet GetLastChangedTypes() const; | |
| 29 | |
| 30 virtual void RegisterHandler(SyncNotifierObserver* handler) OVERRIDE; | |
| 31 virtual void UpdateRegisteredIds(SyncNotifierObserver* handler, | |
| 32 const ObjectIdSet& ids) OVERRIDE; | |
| 33 virtual void UnregisterHandler(SyncNotifierObserver* handler) OVERRIDE; | |
| 34 virtual void SetUniqueId(const std::string& unique_id) OVERRIDE; | |
| 35 virtual void SetStateDeprecated(const std::string& state) OVERRIDE; | |
| 36 virtual void UpdateCredentials( | |
| 37 const std::string& email, const std::string& token) OVERRIDE; | |
| 38 virtual void SendNotification(ModelTypeSet changed_types) OVERRIDE; | |
| 39 | |
| 40 private: | |
| 41 SyncNotifierRegistrar registrar_; | |
| 42 std::string unique_id_; | |
| 43 std::string state_; | |
| 44 std::string email_; | |
| 45 std::string token_; | |
| 46 ModelTypeSet last_changed_types_; | |
| 47 }; | |
| 48 | |
| 49 } // namespace syncer | |
| 50 | |
| 51 #endif // SYNC_NOTIFIER_FAKE_SYNC_NOTIFIER_H_ | |
| OLD | NEW |