Roll src/third_party/WebKit 9f7fb92:f103b33 (svn 202621:202622)
[chromium-blink-merge.git] / components / invalidation / impl / fake_invalidator.h
blob242a8ffa0a2d1fd21bc322766331a77ebb47cec6
1 // Copyright 2014 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 #ifndef COMPONENTS_INVALIDATION_IMPL_FAKE_INVALIDATOR_H_
6 #define COMPONENTS_INVALIDATION_IMPL_FAKE_INVALIDATOR_H_
8 #include <string>
10 #include "base/callback_forward.h"
11 #include "base/compiler_specific.h"
12 #include "components/invalidation/impl/invalidator.h"
13 #include "components/invalidation/impl/invalidator_registrar.h"
14 #include "components/invalidation/public/invalidation_util.h"
16 namespace syncer {
18 class FakeInvalidator : public Invalidator {
19 public:
20 FakeInvalidator();
21 ~FakeInvalidator() override;
23 bool IsHandlerRegistered(InvalidationHandler* handler) const;
24 ObjectIdSet GetRegisteredIds(InvalidationHandler* handler) const;
25 const std::string& GetUniqueId() const;
26 const std::string& GetCredentialsEmail() const;
27 const std::string& GetCredentialsToken() const;
29 void EmitOnInvalidatorStateChange(InvalidatorState state);
30 void EmitOnIncomingInvalidation(
31 const ObjectIdInvalidationMap& invalidation_map);
33 void RegisterHandler(InvalidationHandler* handler) override;
34 bool UpdateRegisteredIds(InvalidationHandler* handler,
35 const ObjectIdSet& ids) override;
36 void UnregisterHandler(InvalidationHandler* handler) override;
37 InvalidatorState GetInvalidatorState() const override;
38 void UpdateCredentials(const std::string& email,
39 const std::string& token) override;
40 void RequestDetailedStatus(base::Callback<void(const base::DictionaryValue&)>
41 callback) const override;
43 private:
44 InvalidatorRegistrar registrar_;
45 std::string state_;
46 std::string email_;
47 std::string token_;
50 } // namespace syncer
52 #endif // COMPONENTS_INVALIDATION_IMPL_FAKE_INVALIDATOR_H_