blob: ed504044c84c795ad336af30151f98c90bc89508 [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
macourteau55a41a62015-05-27 00:23:168#include <set>
9
10#include "base/files/file_path.h"
11
[email protected]d8c8f25f2011-11-02 18:18:0112class ExtensionService;
[email protected]d8c8f25f2011-11-02 18:18:0113
14namespace extensions {
15
[email protected]45759612012-07-10 17:21:2316class ExtensionPrefs;
[email protected]284ffac2014-02-12 01:08:5817class ExtensionRegistry;
[email protected]1c321ee2012-05-21 03:02:3418struct ExtensionInfo;
19
[email protected]d8c8f25f2011-11-02 18:18:0120// Loads installed extensions from the prefs.
21class InstalledLoader {
22 public:
23 explicit InstalledLoader(ExtensionService* extension_service);
24 virtual ~InstalledLoader();
25
26 // Loads extension from prefs.
27 void Load(const ExtensionInfo& info, bool write_to_prefs);
28
29 // Loads all installed extensions (used by startup and testing code).
30 void LoadAllExtensions();
31
32 private:
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);
36
rkaplowa8fd8d32015-02-25 21:27:5637 // Record metrics related to the loaded extensions.
38 void RecordExtensionsMetrics();
39
[email protected]d8c8f25f2011-11-02 18:18:0140 ExtensionService* extension_service_;
[email protected]284ffac2014-02-12 01:08:5841 ExtensionRegistry* extension_registry_;
[email protected]d8c8f25f2011-11-02 18:18:0142
43 ExtensionPrefs* extension_prefs_;
macourteau55a41a62015-05-27 00:23:1644
45 // Paths to invalid extension manifests, which should not be loaded.
46 std::set<base::FilePath> invalid_extensions_;
[email protected]d8c8f25f2011-11-02 18:18:0147};
48
49} // namespace extensions
50
51#endif // CHROME_BROWSER_EXTENSIONS_INSTALLED_LOADER_H_