| 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 #include "sync/notifier/fake_sync_notifier.h" | |
| 6 | |
| 7 namespace syncer { | |
| 8 | |
| 9 FakeSyncNotifier::FakeSyncNotifier() {} | |
| 10 | |
| 11 FakeSyncNotifier::~FakeSyncNotifier() {} | |
| 12 | |
| 13 bool FakeSyncNotifier::IsHandlerRegistered( | |
| 14 SyncNotifierObserver* handler) const { | |
| 15 return registrar_.IsHandlerRegisteredForTest(handler); | |
| 16 } | |
| 17 | |
| 18 ObjectIdSet FakeSyncNotifier::GetRegisteredIds( | |
| 19 SyncNotifierObserver* handler) const { | |
| 20 return registrar_.GetRegisteredIdsForTest(handler); | |
| 21 } | |
| 22 | |
| 23 void FakeSyncNotifier::RegisterHandler(SyncNotifierObserver* handler) { | |
| 24 registrar_.RegisterHandler(handler); | |
| 25 } | |
| 26 | |
| 27 const std::string& FakeSyncNotifier::GetUniqueId() const { | |
| 28 return unique_id_; | |
| 29 } | |
| 30 | |
| 31 const std::string& FakeSyncNotifier::GetStateDeprecated() const { | |
| 32 return state_; | |
| 33 } | |
| 34 | |
| 35 const std::string& FakeSyncNotifier::GetCredentialsEmail() const { | |
| 36 return email_; | |
| 37 } | |
| 38 | |
| 39 const std::string& FakeSyncNotifier::GetCredentialsToken() const { | |
| 40 return token_; | |
| 41 } | |
| 42 | |
| 43 ModelTypeSet FakeSyncNotifier::GetLastChangedTypes() const { | |
| 44 return last_changed_types_; | |
| 45 } | |
| 46 | |
| 47 void FakeSyncNotifier::UpdateRegisteredIds(SyncNotifierObserver* handler, | |
| 48 const ObjectIdSet& ids) { | |
| 49 registrar_.UpdateRegisteredIds(handler, ids); | |
| 50 } | |
| 51 | |
| 52 void FakeSyncNotifier::UnregisterHandler(SyncNotifierObserver* handler) { | |
| 53 registrar_.UnregisterHandler(handler); | |
| 54 } | |
| 55 | |
| 56 void FakeSyncNotifier::SetUniqueId(const std::string& unique_id) { | |
| 57 unique_id_ = unique_id; | |
| 58 } | |
| 59 | |
| 60 void FakeSyncNotifier::SetStateDeprecated(const std::string& state) { | |
| 61 state_ = state; | |
| 62 } | |
| 63 | |
| 64 void FakeSyncNotifier::UpdateCredentials( | |
| 65 const std::string& email, const std::string& token) { | |
| 66 email_ = email; | |
| 67 token_ = token; | |
| 68 } | |
| 69 | |
| 70 void FakeSyncNotifier::SendNotification(ModelTypeSet changed_types) { | |
| 71 last_changed_types_ = changed_types; | |
| 72 } | |
| 73 | |
| 74 } // namespace syncer | |
| OLD | NEW |