| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_INSTALLED_LOADER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_INSTALLED_LOADER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_INSTALLED_LOADER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_INSTALLED_LOADER_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" |
| 9 |
| 8 class ExtensionService; | 10 class ExtensionService; |
| 9 | 11 |
| 10 namespace extensions { | 12 namespace extensions { |
| 11 | 13 |
| 14 class Extension; |
| 12 class ExtensionPrefs; | 15 class ExtensionPrefs; |
| 13 struct ExtensionInfo; | 16 struct ExtensionInfo; |
| 14 | 17 |
| 15 // Loads installed extensions from the prefs. | 18 // Loads installed extensions from the prefs. |
| 16 class InstalledLoader { | 19 class InstalledLoader { |
| 17 public: | 20 public: |
| 18 explicit InstalledLoader(ExtensionService* extension_service); | 21 explicit InstalledLoader(ExtensionService* extension_service); |
| 19 virtual ~InstalledLoader(); | 22 virtual ~InstalledLoader(); |
| 20 | 23 |
| 21 // Loads extension from prefs. | 24 // Loads extension from prefs. |
| 22 void Load(const ExtensionInfo& info, bool write_to_prefs); | 25 scoped_refptr<const Extension> Load(const ExtensionInfo& info, |
| 26 bool write_to_prefs); |
| 23 | 27 |
| 24 // Loads all installed extensions (used by startup and testing code). | 28 // Loads all installed extensions (used by startup and testing code). |
| 25 void LoadAllExtensions(); | 29 void LoadAllExtensions(); |
| 26 | 30 |
| 27 private: | 31 private: |
| 28 // Returns the flags that should be used with Extension::Create() for an | 32 // Returns the flags that should be used with Extension::Create() for an |
| 29 // extension that is already installed. | 33 // extension that is already installed. |
| 30 int GetCreationFlags(const ExtensionInfo* info); | 34 int GetCreationFlags(const ExtensionInfo* info); |
| 31 | 35 |
| 32 ExtensionService* extension_service_; | 36 ExtensionService* extension_service_; |
| 33 | 37 |
| 34 ExtensionPrefs* extension_prefs_; | 38 ExtensionPrefs* extension_prefs_; |
| 35 }; | 39 }; |
| 36 | 40 |
| 37 } // namespace extensions | 41 } // namespace extensions |
| 38 | 42 |
| 39 #endif // CHROME_BROWSER_EXTENSIONS_INSTALLED_LOADER_H_ | 43 #endif // CHROME_BROWSER_EXTENSIONS_INSTALLED_LOADER_H_ |
| OLD | NEW |