• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2014 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 
5 #ifndef CEF_LIBCEF_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_FACTORY_H_
6 #define CEF_LIBCEF_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_FACTORY_H_
7 
8 #include "base/memory/singleton.h"
9 #include "extensions/browser/extension_system_provider.h"
10 
11 namespace extensions {
12 
13 // Factory that provides CefExtensionSystem.
14 class CefExtensionSystemFactory : public ExtensionSystemProvider {
15  public:
16   CefExtensionSystemFactory(const CefExtensionSystemFactory&) = delete;
17   CefExtensionSystemFactory& operator=(const CefExtensionSystemFactory&) =
18       delete;
19 
20   // ExtensionSystemProvider implementation:
21   ExtensionSystem* GetForBrowserContext(
22       content::BrowserContext* context) override;
23 
24   static CefExtensionSystemFactory* GetInstance();
25 
26  private:
27   friend struct base::DefaultSingletonTraits<CefExtensionSystemFactory>;
28 
29   CefExtensionSystemFactory();
30   ~CefExtensionSystemFactory() override;
31 
32   // BrowserContextKeyedServiceFactory implementation:
33   KeyedService* BuildServiceInstanceFor(
34       content::BrowserContext* context) const override;
35   content::BrowserContext* GetBrowserContextToUse(
36       content::BrowserContext* context) const override;
37   bool ServiceIsCreatedWithBrowserContext() const override;
38 };
39 
40 }  // namespace extensions
41 
42 #endif  // CEF_LIBCEF_BROWSER_EXTENSIONS_EXTENSION_SYSTEM_FACTORY_H_
43