| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_INVALIDATION_FAKE_INVALIDATION_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_INVALIDATION_FAKE_INVALIDATION_SERVICE_H_ |
| 6 #define CHROME_BROWSER_INVALIDATION_FAKE_INVALIDATION_SERVICE_H_ | 6 #define CHROME_BROWSER_INVALIDATION_FAKE_INVALIDATION_SERVICE_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
| 13 #include "chrome/browser/signin/fake_profile_oauth2_token_service.h" | 13 #include "chrome/browser/signin/fake_profile_oauth2_token_service.h" |
| 14 #include "components/invalidation/invalidation_service.h" | 14 #include "components/invalidation/invalidation_service.h" |
| 15 #include "components/invalidation/invalidator_registrar.h" | 15 #include "components/invalidation/invalidator_registrar.h" |
| 16 #include "google_apis/gaia/fake_identity_provider.h" | 16 #include "google_apis/gaia/fake_identity_provider.h" |
| 17 #include "sync/notifier/mock_ack_handler.h" | 17 #include "sync/notifier/mock_ack_handler.h" |
| 18 | 18 |
| 19 namespace content { | |
| 20 class BrowserContext; | |
| 21 } | |
| 22 | |
| 23 namespace syncer { | 19 namespace syncer { |
| 24 class Invalidation; | 20 class Invalidation; |
| 25 } | 21 } |
| 26 | 22 |
| 27 namespace invalidation { | 23 namespace invalidation { |
| 28 | 24 |
| 29 class InvalidationLogger; | 25 class InvalidationLogger; |
| 30 | 26 |
| 31 // An InvalidationService that emits invalidations only when | 27 // An InvalidationService that emits invalidations only when |
| 32 // its EmitInvalidationForTest method is called. | 28 // its EmitInvalidationForTest method is called. |
| 33 class FakeInvalidationService : public InvalidationService { | 29 class FakeInvalidationService : public InvalidationService { |
| 34 public: | 30 public: |
| 35 FakeInvalidationService(); | 31 FakeInvalidationService(); |
| 36 virtual ~FakeInvalidationService(); | 32 virtual ~FakeInvalidationService(); |
| 37 | 33 |
| 38 static KeyedService* Build(content::BrowserContext* context); | |
| 39 | |
| 40 virtual void RegisterInvalidationHandler( | 34 virtual void RegisterInvalidationHandler( |
| 41 syncer::InvalidationHandler* handler) OVERRIDE; | 35 syncer::InvalidationHandler* handler) OVERRIDE; |
| 42 virtual void UpdateRegisteredInvalidationIds( | 36 virtual void UpdateRegisteredInvalidationIds( |
| 43 syncer::InvalidationHandler* handler, | 37 syncer::InvalidationHandler* handler, |
| 44 const syncer::ObjectIdSet& ids) OVERRIDE; | 38 const syncer::ObjectIdSet& ids) OVERRIDE; |
| 45 virtual void UnregisterInvalidationHandler( | 39 virtual void UnregisterInvalidationHandler( |
| 46 syncer::InvalidationHandler* handler) OVERRIDE; | 40 syncer::InvalidationHandler* handler) OVERRIDE; |
| 47 | 41 |
| 48 virtual syncer::InvalidatorState GetInvalidatorState() const OVERRIDE; | 42 virtual syncer::InvalidatorState GetInvalidatorState() const OVERRIDE; |
| 49 virtual std::string GetInvalidatorClientId() const OVERRIDE; | 43 virtual std::string GetInvalidatorClientId() const OVERRIDE; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 70 syncer::MockAckHandler mock_ack_handler_; | 64 syncer::MockAckHandler mock_ack_handler_; |
| 71 FakeProfileOAuth2TokenService token_service_; | 65 FakeProfileOAuth2TokenService token_service_; |
| 72 FakeIdentityProvider identity_provider_; | 66 FakeIdentityProvider identity_provider_; |
| 73 | 67 |
| 74 DISALLOW_COPY_AND_ASSIGN(FakeInvalidationService); | 68 DISALLOW_COPY_AND_ASSIGN(FakeInvalidationService); |
| 75 }; | 69 }; |
| 76 | 70 |
| 77 } // namespace invalidation | 71 } // namespace invalidation |
| 78 | 72 |
| 79 #endif // CHROME_BROWSER_INVALIDATION_FAKE_INVALIDATION_SERVICE_H_ | 73 #endif // CHROME_BROWSER_INVALIDATION_FAKE_INVALIDATION_SERVICE_H_ |
| OLD | NEW |