interested_data_types_handler.h 1.2 KB

12345678910111213141516171819202122232425262728293031
  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. #ifndef COMPONENTS_SYNC_INVALIDATIONS_INTERESTED_DATA_TYPES_HANDLER_H_
  5. #define COMPONENTS_SYNC_INVALIDATIONS_INTERESTED_DATA_TYPES_HANDLER_H_
  6. #include "base/callback_forward.h"
  7. #include "components/sync/base/model_type.h"
  8. namespace syncer {
  9. // An interface to handle changes on data types for which the device wants to
  10. // receive invalidations. Implementations are expected to call the provided
  11. // callback when the list of data types is sent to the Sync server.
  12. class InterestedDataTypesHandler {
  13. public:
  14. virtual ~InterestedDataTypesHandler() = default;
  15. // Called on each change of interested data types.
  16. virtual void OnInterestedDataTypesChanged() = 0;
  17. // Called to provide an interface to invoke GetUpdates after any additional
  18. // interested data types get committed.
  19. virtual void SetCommittedAdditionalInterestedDataTypesCallback(
  20. base::RepeatingCallback<void(const ModelTypeSet&)> callback) = 0;
  21. };
  22. } // namespace syncer
  23. #endif // COMPONENTS_SYNC_INVALIDATIONS_INTERESTED_DATA_TYPES_HANDLER_H_