favicon_service_impl_factory.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 WEBLAYER_BROWSER_FAVICON_FAVICON_SERVICE_IMPL_FACTORY_H_
  5. #define WEBLAYER_BROWSER_FAVICON_FAVICON_SERVICE_IMPL_FACTORY_H_
  6. #include "base/no_destructor.h"
  7. #include "components/keyed_service/content/browser_context_keyed_service_factory.h"
  8. namespace content {
  9. class BrowserContext;
  10. }
  11. namespace weblayer {
  12. class FaviconServiceImpl;
  13. // BrowserContextKeyedServiceFactory for getting the FaviconServiceImpl.
  14. class FaviconServiceImplFactory : public BrowserContextKeyedServiceFactory {
  15. public:
  16. FaviconServiceImplFactory(const FaviconServiceImplFactory&) = delete;
  17. FaviconServiceImplFactory& operator=(const FaviconServiceImplFactory&) =
  18. delete;
  19. // Off the record profiles do not have a FaviconServiceImpl.
  20. static FaviconServiceImpl* GetForBrowserContext(
  21. content::BrowserContext* browser_context);
  22. // Returns the FaviconServiceFactory singleton.
  23. static FaviconServiceImplFactory* GetInstance();
  24. private:
  25. friend class base::NoDestructor<FaviconServiceImplFactory>;
  26. FaviconServiceImplFactory();
  27. ~FaviconServiceImplFactory() override;
  28. // BrowserContextKeyedServiceFactory:
  29. KeyedService* BuildServiceInstanceFor(
  30. content::BrowserContext* context) const override;
  31. bool ServiceIsNULLWhileTesting() const override;
  32. };
  33. } // namespace weblayer
  34. #endif // WEBLAYER_BROWSER_FAVICON_FAVICON_SERVICE_IMPL_FACTORY_H_