dummy_segmentation_platform_service.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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_SEGMENTATION_PLATFORM_INTERNAL_DUMMY_SEGMENTATION_PLATFORM_SERVICE_H_
  5. #define COMPONENTS_SEGMENTATION_PLATFORM_INTERNAL_DUMMY_SEGMENTATION_PLATFORM_SERVICE_H_
  6. #include <string>
  7. #include "components/segmentation_platform/public/segmentation_platform_service.h"
  8. namespace segmentation_platform {
  9. // A dummy implementation of the SegmentationPlatformService that can be
  10. // returned whenever the feature is not enabled.
  11. class DummySegmentationPlatformService : public SegmentationPlatformService {
  12. public:
  13. DummySegmentationPlatformService();
  14. ~DummySegmentationPlatformService() override;
  15. // Disallow copy/assign.
  16. DummySegmentationPlatformService(const DummySegmentationPlatformService&) =
  17. delete;
  18. DummySegmentationPlatformService& operator=(
  19. const DummySegmentationPlatformService&) = delete;
  20. // SegmentationPlatformService overrides.
  21. void GetSelectedSegment(const std::string& segmentation_key,
  22. SegmentSelectionCallback callback) override;
  23. SegmentSelectionResult GetCachedSegmentResult(
  24. const std::string& segmentation_key) override;
  25. void GetSelectedSegmentOnDemand(const std::string& segmentation_key,
  26. scoped_refptr<InputContext> input_context,
  27. SegmentSelectionCallback callback) override;
  28. void EnableMetrics(bool signal_collection_allowed) override;
  29. bool IsPlatformInitialized() override;
  30. };
  31. } // namespace segmentation_platform
  32. #endif // COMPONENTS_SEGMENTATION_PLATFORM_INTERNAL_DUMMY_SEGMENTATION_PLATFORM_SERVICE_H_