stateful_ssl_host_state_delegate_factory.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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_STATEFUL_SSL_HOST_STATE_DELEGATE_FACTORY_H_
  5. #define WEBLAYER_BROWSER_STATEFUL_SSL_HOST_STATE_DELEGATE_FACTORY_H_
  6. #include "base/memory/singleton.h"
  7. #include "components/keyed_service/content/browser_context_keyed_service_factory.h"
  8. #include "components/prefs/pref_service.h"
  9. class StatefulSSLHostStateDelegate;
  10. namespace weblayer {
  11. // Singleton that associates all StatefulSSLHostStateDelegates with
  12. // BrowserContexts.
  13. class StatefulSSLHostStateDelegateFactory
  14. : public BrowserContextKeyedServiceFactory {
  15. public:
  16. static StatefulSSLHostStateDelegate* GetForBrowserContext(
  17. content::BrowserContext* browser_context);
  18. static StatefulSSLHostStateDelegateFactory* GetInstance();
  19. private:
  20. friend struct base::DefaultSingletonTraits<
  21. StatefulSSLHostStateDelegateFactory>;
  22. StatefulSSLHostStateDelegateFactory();
  23. ~StatefulSSLHostStateDelegateFactory() override;
  24. StatefulSSLHostStateDelegateFactory(
  25. const StatefulSSLHostStateDelegateFactory&) = delete;
  26. StatefulSSLHostStateDelegateFactory& operator=(
  27. const StatefulSSLHostStateDelegateFactory&) = delete;
  28. // BrowserContextKeyedServiceFactory methods:
  29. KeyedService* BuildServiceInstanceFor(
  30. content::BrowserContext* context) const override;
  31. content::BrowserContext* GetBrowserContextToUse(
  32. content::BrowserContext* context) const override;
  33. };
  34. } // namespace weblayer
  35. #endif // WEBLAYER_BROWSER_STATEFUL_SSL_HOST_STATE_DELEGATE_FACTORY_H_