blob: 3bf40167b2c91ec58cfa484fbe2904765033bf64 [file] [log] [blame]
[email protected]5fdfa562013-12-27 17:43:591// Copyright 2013 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 EXTENSIONS_BROWSER_EXTENSION_REGISTRY_FACTORY_H_
6#define EXTENSIONS_BROWSER_EXTENSION_REGISTRY_FACTORY_H_
7
8#include "base/compiler_specific.h"
9#include "base/memory/singleton.h"
[email protected]b33f0b112014-03-13 17:05:3010#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
[email protected]5fdfa562013-12-27 17:43:5911
12namespace extensions {
13
14class ExtensionRegistry;
15
16// Factory for ExtensionRegistry objects. ExtensionRegistry objects are shared
17// between an incognito browser context and its master browser context.
18class ExtensionRegistryFactory : public BrowserContextKeyedServiceFactory {
19 public:
20 static ExtensionRegistry* GetForBrowserContext(
21 content::BrowserContext* context);
22
23 static ExtensionRegistryFactory* GetInstance();
24
25 private:
26 friend struct DefaultSingletonTraits<ExtensionRegistryFactory>;
27
28 ExtensionRegistryFactory();
dcheng9168b2f2014-10-21 12:38:2429 ~ExtensionRegistryFactory() override;
[email protected]5fdfa562013-12-27 17:43:5930
31 // BrowserContextKeyedServiceFactory implementation:
dcheng9168b2f2014-10-21 12:38:2432 KeyedService* BuildServiceInstanceFor(
mostynb0eac4e1b2014-10-03 16:32:1933 content::BrowserContext* context) const override;
dcheng9168b2f2014-10-21 12:38:2434 content::BrowserContext* GetBrowserContextToUse(
mostynb0eac4e1b2014-10-03 16:32:1935 content::BrowserContext* context) const override;
[email protected]5fdfa562013-12-27 17:43:5936
[email protected]5fdfa562013-12-27 17:43:5937 DISALLOW_COPY_AND_ASSIGN(ExtensionRegistryFactory);
38};
39
40} // namespace extensions
41
42#endif // EXTENSIONS_BROWSER_EXTENSION_REGISTRY_FACTORY_H_