| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_FAKE_SERVER_INVALIDATION_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_FAKE_SERVER_INVALIDATION_SERVICE_H_ |
| 6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_FAKE_SERVER_INVALIDATION_SERVICE_H_ | 6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_FAKE_SERVER_INVALIDATION_SERVICE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 namespace fake_server { | 23 namespace fake_server { |
| 24 | 24 |
| 25 // An InvalidationService that is used in conjunction with FakeServer. | 25 // An InvalidationService that is used in conjunction with FakeServer. |
| 26 class FakeServerInvalidationService : public invalidation::InvalidationService, | 26 class FakeServerInvalidationService : public invalidation::InvalidationService, |
| 27 public FakeServer::Observer { | 27 public FakeServer::Observer { |
| 28 public: | 28 public: |
| 29 FakeServerInvalidationService(); | 29 FakeServerInvalidationService(); |
| 30 virtual ~FakeServerInvalidationService(); | 30 virtual ~FakeServerInvalidationService(); |
| 31 | 31 |
| 32 virtual void RegisterInvalidationHandler( | 32 virtual void RegisterInvalidationHandler( |
| 33 syncer::InvalidationHandler* handler) OVERRIDE; | 33 syncer::InvalidationHandler* handler) override; |
| 34 virtual void UpdateRegisteredInvalidationIds( | 34 virtual void UpdateRegisteredInvalidationIds( |
| 35 syncer::InvalidationHandler* handler, | 35 syncer::InvalidationHandler* handler, |
| 36 const syncer::ObjectIdSet& ids) OVERRIDE; | 36 const syncer::ObjectIdSet& ids) override; |
| 37 virtual void UnregisterInvalidationHandler( | 37 virtual void UnregisterInvalidationHandler( |
| 38 syncer::InvalidationHandler* handler) OVERRIDE; | 38 syncer::InvalidationHandler* handler) override; |
| 39 | 39 |
| 40 virtual syncer::InvalidatorState GetInvalidatorState() const OVERRIDE; | 40 virtual syncer::InvalidatorState GetInvalidatorState() const override; |
| 41 virtual std::string GetInvalidatorClientId() const OVERRIDE; | 41 virtual std::string GetInvalidatorClientId() const override; |
| 42 virtual invalidation::InvalidationLogger* GetInvalidationLogger() OVERRIDE; | 42 virtual invalidation::InvalidationLogger* GetInvalidationLogger() override; |
| 43 virtual void RequestDetailedStatus( | 43 virtual void RequestDetailedStatus( |
| 44 base::Callback<void(const base::DictionaryValue&)> caller) const OVERRIDE; | 44 base::Callback<void(const base::DictionaryValue&)> caller) const override; |
| 45 virtual IdentityProvider* GetIdentityProvider() OVERRIDE; | 45 virtual IdentityProvider* GetIdentityProvider() override; |
| 46 | 46 |
| 47 // Functions to enable or disable sending of self-notifications. In the real | 47 // Functions to enable or disable sending of self-notifications. In the real |
| 48 // world, clients do not receive notifications of their own commits. | 48 // world, clients do not receive notifications of their own commits. |
| 49 void EnableSelfNotifications(); | 49 void EnableSelfNotifications(); |
| 50 void DisableSelfNotifications(); | 50 void DisableSelfNotifications(); |
| 51 | 51 |
| 52 // FakeServer::Observer: | 52 // FakeServer::Observer: |
| 53 virtual void OnCommit( | 53 virtual void OnCommit( |
| 54 const std::string& committer_id, | 54 const std::string& committer_id, |
| 55 syncer::ModelTypeSet committed_model_types) OVERRIDE; | 55 syncer::ModelTypeSet committed_model_types) override; |
| 56 | 56 |
| 57 private: | 57 private: |
| 58 std::string client_id_; | 58 std::string client_id_; |
| 59 bool self_notify_; | 59 bool self_notify_; |
| 60 | 60 |
| 61 syncer::InvalidatorRegistrar invalidator_registrar_; | 61 syncer::InvalidatorRegistrar invalidator_registrar_; |
| 62 FakeProfileOAuth2TokenService token_service_; | 62 FakeProfileOAuth2TokenService token_service_; |
| 63 FakeIdentityProvider identity_provider_; | 63 FakeIdentityProvider identity_provider_; |
| 64 | 64 |
| 65 DISALLOW_COPY_AND_ASSIGN(FakeServerInvalidationService); | 65 DISALLOW_COPY_AND_ASSIGN(FakeServerInvalidationService); |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 } // namespace fake_server | 68 } // namespace fake_server |
| 69 | 69 |
| 70 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_FAKE_SERVER_INVALIDATION_SERVICE
_H_ | 70 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_FAKE_SERVER_INVALIDATION_SERVICE
_H_ |
| OLD | NEW |