Get foreground tab on Android
[chromium-blink-merge.git] / sync / notifier / fake_invalidator.cc
blob0b217f79e1e309753a0c087a6b6e4b2aa95f75cd
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.
5 #include "sync/notifier/fake_invalidator.h"
7 namespace syncer {
9 FakeInvalidator::FakeInvalidator() {}
11 FakeInvalidator::~FakeInvalidator() {}
13 bool FakeInvalidator::IsHandlerRegistered(InvalidationHandler* handler) const {
14 return registrar_.IsHandlerRegisteredForTest(handler);
17 ObjectIdSet FakeInvalidator::GetRegisteredIds(
18 InvalidationHandler* handler) const {
19 return registrar_.GetRegisteredIds(handler);
22 const std::string& FakeInvalidator::GetCredentialsEmail() const {
23 return email_;
26 const std::string& FakeInvalidator::GetCredentialsToken() const {
27 return token_;
30 void FakeInvalidator::EmitOnInvalidatorStateChange(InvalidatorState state) {
31 registrar_.UpdateInvalidatorState(state);
34 void FakeInvalidator::EmitOnIncomingInvalidation(
35 const ObjectIdInvalidationMap& invalidation_map) {
36 registrar_.DispatchInvalidationsToHandlers(invalidation_map);
39 void FakeInvalidator::RegisterHandler(InvalidationHandler* handler) {
40 registrar_.RegisterHandler(handler);
43 void FakeInvalidator::UpdateRegisteredIds(InvalidationHandler* handler,
44 const ObjectIdSet& ids) {
45 registrar_.UpdateRegisteredIds(handler, ids);
48 void FakeInvalidator::UnregisterHandler(InvalidationHandler* handler) {
49 registrar_.UnregisterHandler(handler);
52 void FakeInvalidator::Acknowledge(const invalidation::ObjectId& id,
53 const AckHandle& ack_handle) {
54 // Do nothing.
57 InvalidatorState FakeInvalidator::GetInvalidatorState() const {
58 return registrar_.GetInvalidatorState();
61 void FakeInvalidator::UpdateCredentials(
62 const std::string& email, const std::string& token) {
63 email_ = email;
64 token_ = token;
67 } // namespace syncer