1 // Copyright (c) 2012 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.
5 #ifndef CHROME_BROWSER_EXTENSIONS_INSTALLED_LOADER_H_
6 #define CHROME_BROWSER_EXTENSIONS_INSTALLED_LOADER_H_
10 #include "base/files/file_path.h"
12 class ExtensionService
;
14 namespace extensions
{
17 class ExtensionRegistry
;
20 // Loads installed extensions from the prefs.
21 class InstalledLoader
{
23 explicit InstalledLoader(ExtensionService
* extension_service
);
24 virtual ~InstalledLoader();
26 // Loads extension from prefs.
27 void Load(const ExtensionInfo
& info
, bool write_to_prefs
);
29 // Loads all installed extensions (used by startup and testing code).
30 void LoadAllExtensions();
33 // Returns the flags that should be used with Extension::Create() for an
34 // extension that is already installed.
35 int GetCreationFlags(const ExtensionInfo
* info
);
37 // Record metrics related to the loaded extensions.
38 void RecordExtensionsMetrics();
40 ExtensionService
* extension_service_
;
41 ExtensionRegistry
* extension_registry_
;
43 ExtensionPrefs
* extension_prefs_
;
45 // Paths to invalid extension manifests, which should not be loaded.
46 std::set
<base::FilePath
> invalid_extensions_
;
49 } // namespace extensions
51 #endif // CHROME_BROWSER_EXTENSIONS_INSTALLED_LOADER_H_