| 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_COMPONENT_LOADER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_COMPONENT_LOADER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_COMPONENT_LOADER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_COMPONENT_LOADER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 size_t registered_extensions_count() const { | 33 size_t registered_extensions_count() const { |
| 34 return component_extensions_.size(); | 34 return component_extensions_.size(); |
| 35 } | 35 } |
| 36 | 36 |
| 37 // Loads any registered component extensions. | 37 // Loads any registered component extensions. |
| 38 void LoadAll(); | 38 void LoadAll(); |
| 39 | 39 |
| 40 // Registers and possibly loads a component extension. If ExtensionService | 40 // Registers and possibly loads a component extension. If ExtensionService |
| 41 // has been initialized, the extension is loaded; otherwise, the load is | 41 // has been initialized, the extension is loaded; otherwise, the load is |
| 42 // deferred until LoadAll is called. | 42 // deferred until LoadAll is called. |
| 43 const Extension* Add(std::string& manifest_contents, | 43 const Extension* Add(const std::string& manifest_contents, |
| 44 const FilePath& root_directory); | 44 const FilePath& root_directory); |
| 45 | 45 |
| 46 // Convenience method for registering a component extension by resource id. | 46 // Convenience method for registering a component extension by resource id. |
| 47 const Extension* Add(int manifest_resource_id, | 47 const Extension* Add(int manifest_resource_id, |
| 48 const FilePath& root_directory); | 48 const FilePath& root_directory); |
| 49 | 49 |
| 50 // Loads a component extension from file system. Replaces previously added | 50 // Loads a component extension from file system. Replaces previously added |
| 51 // extension with the same ID. | 51 // extension with the same ID. |
| 52 const Extension* AddOrReplace(const FilePath& path); | 52 const Extension* AddOrReplace(const FilePath& path); |
| 53 | 53 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 | 110 |
| 111 void AddFileManagerExtension(); | 111 void AddFileManagerExtension(); |
| 112 | 112 |
| 113 #if defined(OS_CHROMEOS) | 113 #if defined(OS_CHROMEOS) |
| 114 void AddGaiaAuthExtension(); | 114 void AddGaiaAuthExtension(); |
| 115 #endif | 115 #endif |
| 116 | 116 |
| 117 // Add the enterprise webstore extension, or reload it if already loaded. | 117 // Add the enterprise webstore extension, or reload it if already loaded. |
| 118 void AddOrReloadEnterpriseWebStore(); | 118 void AddOrReloadEnterpriseWebStore(); |
| 119 | 119 |
| 120 void AddChromeApp(); |
| 121 |
| 120 // Determine the extension id. | 122 // Determine the extension id. |
| 121 static std::string GenerateId(const base::DictionaryValue* manifest); | 123 static std::string GenerateId(const base::DictionaryValue* manifest); |
| 122 | 124 |
| 123 PrefService* prefs_; | 125 PrefService* prefs_; |
| 124 PrefService* local_state_; | 126 PrefService* local_state_; |
| 125 | 127 |
| 126 ExtensionServiceInterface* extension_service_; | 128 ExtensionServiceInterface* extension_service_; |
| 127 | 129 |
| 128 // List of registered component extensions (see Extension::Location). | 130 // List of registered component extensions (see Extension::Location). |
| 129 typedef std::vector<ComponentExtensionInfo> RegisteredComponentExtensions; | 131 typedef std::vector<ComponentExtensionInfo> RegisteredComponentExtensions; |
| 130 RegisteredComponentExtensions component_extensions_; | 132 RegisteredComponentExtensions component_extensions_; |
| 131 | 133 |
| 132 PrefChangeRegistrar pref_change_registrar_; | 134 PrefChangeRegistrar pref_change_registrar_; |
| 133 | 135 |
| 134 DISALLOW_COPY_AND_ASSIGN(ComponentLoader); | 136 DISALLOW_COPY_AND_ASSIGN(ComponentLoader); |
| 135 }; | 137 }; |
| 136 | 138 |
| 137 } // namespace extensions | 139 } // namespace extensions |
| 138 | 140 |
| 139 #endif // CHROME_BROWSER_EXTENSIONS_COMPONENT_LOADER_H_ | 141 #endif // CHROME_BROWSER_EXTENSIONS_COMPONENT_LOADER_H_ |
| OLD | NEW |