desk_sync_service.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright 2021 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_DESKS_STORAGE_CORE_DESK_SYNC_SERVICE_H_
  5. #define COMPONENTS_DESKS_STORAGE_CORE_DESK_SYNC_SERVICE_H_
  6. #include <memory>
  7. #include "base/memory/weak_ptr.h"
  8. #include "components/account_id/account_id.h"
  9. #include "components/keyed_service/core/keyed_service.h"
  10. #include "components/sync/model/model_type_store_service.h"
  11. #include "components/version_info/channel.h"
  12. namespace syncer {
  13. class ModelTypeControllerDelegate;
  14. } // namespace syncer
  15. namespace desks_storage {
  16. class DeskSyncBridge;
  17. class DeskModel;
  18. // KeyedService responsible for desk templates sync.
  19. class DeskSyncService : public KeyedService {
  20. public:
  21. DeskSyncService(version_info::Channel channel,
  22. syncer::OnceModelTypeStoreFactory create_store_callback,
  23. const AccountId& account_id);
  24. DeskSyncService(const DeskSyncService&) = delete;
  25. DeskSyncService& operator=(const DeskSyncService&) = delete;
  26. ~DeskSyncService() override;
  27. virtual DeskModel* GetDeskModel();
  28. virtual base::WeakPtr<syncer::ModelTypeControllerDelegate>
  29. GetControllerDelegate();
  30. private:
  31. std::unique_ptr<DeskSyncBridge> bridge_;
  32. };
  33. } // namespace desks_storage
  34. #endif // COMPONENTS_DESKS_STORAGE_CORE_DESK_SYNC_SERVICE_H_