blob: 8d8ec7f166e2c6e71bedb26cefb259a5a5705804 [file] [log] [blame]
[email protected]45759612012-07-10 17:21:231// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]d8c8f25f2011-11-02 18:18:012// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CHROME_BROWSER_EXTENSIONS_INSTALLED_LOADER_H_
6#define CHROME_BROWSER_EXTENSIONS_INSTALLED_LOADER_H_
[email protected]d8c8f25f2011-11-02 18:18:017
[email protected]d8c8f25f2011-11-02 18:18:018class ExtensionService;
[email protected]d8c8f25f2011-11-02 18:18:019
10namespace extensions {
11
[email protected]45759612012-07-10 17:21:2312class ExtensionPrefs;
[email protected]284ffac2014-02-12 01:08:5813class ExtensionRegistry;
[email protected]1c321ee2012-05-21 03:02:3414struct ExtensionInfo;
15
[email protected]d8c8f25f2011-11-02 18:18:0116// Loads installed extensions from the prefs.
17class InstalledLoader {
18 public:
19 explicit InstalledLoader(ExtensionService* extension_service);
20 virtual ~InstalledLoader();
21
22 // Loads extension from prefs.
23 void Load(const ExtensionInfo& info, bool write_to_prefs);
24
25 // Loads all installed extensions (used by startup and testing code).
26 void LoadAllExtensions();
27
28 private:
29 // Returns the flags that should be used with Extension::Create() for an
30 // extension that is already installed.
31 int GetCreationFlags(const ExtensionInfo* info);
32
rkaplowa8fd8d32015-02-25 21:27:5633 // Record metrics related to the loaded extensions.
34 void RecordExtensionsMetrics();
35
[email protected]d8c8f25f2011-11-02 18:18:0136 ExtensionService* extension_service_;
[email protected]284ffac2014-02-12 01:08:5837 ExtensionRegistry* extension_registry_;
[email protected]d8c8f25f2011-11-02 18:18:0138
39 ExtensionPrefs* extension_prefs_;
40};
41
42} // namespace extensions
43
44#endif // CHROME_BROWSER_EXTENSIONS_INSTALLED_LOADER_H_