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