Rushan Suleymanov | d5c5ef5 | 2020-07-30 13:07:24 | [diff] [blame] | 1 | // Copyright 2020 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. |
| 4 | |
| 5 | #ifndef COMPONENTS_SYNC_INVALIDATIONS_SYNC_INVALIDATIONS_SERVICE_IMPL_H_ |
| 6 | #define COMPONENTS_SYNC_INVALIDATIONS_SYNC_INVALIDATIONS_SERVICE_IMPL_H_ |
| 7 | |
| 8 | #include <memory> |
| 9 | #include <string> |
| 10 | |
Paula Vidas | 4f26b666 | 2020-09-03 09:16:23 | [diff] [blame] | 11 | #include "components/sync/invalidations/interested_data_types_manager.h" |
Rushan Suleymanov | d5c5ef5 | 2020-07-30 13:07:24 | [diff] [blame] | 12 | #include "components/sync/invalidations/sync_invalidations_service.h" |
| 13 | |
| 14 | namespace gcm { |
| 15 | class GCMDriver; |
| 16 | } |
| 17 | |
| 18 | namespace instance_id { |
| 19 | class InstanceIDDriver; |
| 20 | } |
| 21 | |
| 22 | namespace syncer { |
| 23 | class FCMHandler; |
| 24 | class InvalidationsListener; |
| 25 | |
| 26 | // The non-test implementation of SyncInvalidationsService. |
| 27 | class SyncInvalidationsServiceImpl : public SyncInvalidationsService { |
| 28 | public: |
| 29 | SyncInvalidationsServiceImpl( |
| 30 | gcm::GCMDriver* gcm_driver, |
Marc Treib | b1428bf | 2020-09-09 13:08:42 | [diff] [blame^] | 31 | instance_id::InstanceIDDriver* instance_id_driver); |
Rushan Suleymanov | d5c5ef5 | 2020-07-30 13:07:24 | [diff] [blame] | 32 | ~SyncInvalidationsServiceImpl() override; |
| 33 | |
| 34 | // SyncInvalidationsService implementation. |
| 35 | void AddListener(InvalidationsListener* listener) override; |
| 36 | void RemoveListener(InvalidationsListener* listener) override; |
Rushan Suleymanov | 74e7ee259 | 2020-08-02 19:30:40 | [diff] [blame] | 37 | void AddTokenObserver(FCMRegistrationTokenObserver* observer) override; |
| 38 | void RemoveTokenObserver(FCMRegistrationTokenObserver* observer) override; |
| 39 | const std::string& GetFCMRegistrationToken() const override; |
Paula Vidas | 4f26b666 | 2020-09-03 09:16:23 | [diff] [blame] | 40 | void AddInterestedDataTypesObserver( |
| 41 | InterestedDataTypesObserver* observer) override; |
| 42 | void RemoveInterestedDataTypesObserver( |
| 43 | InterestedDataTypesObserver* observer) override; |
| 44 | const ModelTypeSet& GetInterestedDataTypes() const override; |
| 45 | void SetInterestedDataTypes(const ModelTypeSet& data_types) override; |
Rushan Suleymanov | d5c5ef5 | 2020-07-30 13:07:24 | [diff] [blame] | 46 | |
| 47 | // KeyedService overrides. |
| 48 | void Shutdown() override; |
| 49 | |
| 50 | private: |
| 51 | std::unique_ptr<FCMHandler> fcm_handler_; |
Paula Vidas | 4f26b666 | 2020-09-03 09:16:23 | [diff] [blame] | 52 | InterestedDataTypesManager data_types_manager_; |
Rushan Suleymanov | d5c5ef5 | 2020-07-30 13:07:24 | [diff] [blame] | 53 | }; |
| 54 | |
| 55 | } // namespace syncer |
| 56 | |
| 57 | #endif // COMPONENTS_SYNC_INVALIDATIONS_SYNC_INVALIDATIONS_SERVICE_IMPL_H_ |