image_fetcher_service_provider.h 1.1 KB

1234567891011121314151617181920212223242526272829303132
  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_IMAGE_FETCHER_IMAGE_FETCHER_SERVICE_PROVIDER_H_
  5. #define COMPONENTS_IMAGE_FETCHER_IMAGE_FETCHER_SERVICE_PROVIDER_H_
  6. #include "base/callback.h"
  7. class SimpleFactoryKey;
  8. namespace image_fetcher {
  9. class ImageFetcherService;
  10. using ImageFetcherServiceProvider =
  11. base::RepeatingCallback<ImageFetcherService*(SimpleFactoryKey* key)>;
  12. using ImageFetcherCachePathProvider =
  13. base::RepeatingCallback<std::string(SimpleFactoryKey* key,
  14. std::string path)>;
  15. void SetImageFetcherServiceProvider(
  16. const ImageFetcherServiceProvider& provider);
  17. ImageFetcherService* GetImageFetcherService(SimpleFactoryKey* key);
  18. void SetImageFetcherCachePathProvider(
  19. const ImageFetcherCachePathProvider& provider);
  20. std::string GetImageFetcherCachePath(SimpleFactoryKey* key, std::string path);
  21. } // namespace image_fetcher
  22. #endif // COMPONENTS_IMAGE_FETCHER_IMAGE_FETCHER_SERVICE_PROVIDER_H_