| 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 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 std::string AddOrReplace(const FilePath& path); | 58 std::string AddOrReplace(const FilePath& path); |
| 59 | 59 |
| 60 // Returns true if an extension with the specified id has been added. | 60 // Returns true if an extension with the specified id has been added. |
| 61 bool Exists(const std::string& id) const; | 61 bool Exists(const std::string& id) const; |
| 62 | 62 |
| 63 // Unloads a component extension and removes it from the list of component | 63 // Unloads a component extension and removes it from the list of component |
| 64 // extensions to be loaded. | 64 // extensions to be loaded. |
| 65 void Remove(const FilePath& root_directory); | 65 void Remove(const FilePath& root_directory); |
| 66 void Remove(const std::string& id); | 66 void Remove(const std::string& id); |
| 67 | 67 |
| 68 // Call this during test setup to load component extensions that have |
| 69 // background pages for testing, which could otherwise interfere with tests. |
| 70 static void EnableBackgroundExtensionsForTesting(); |
| 71 |
| 68 // Adds the default component extensions. | 72 // Adds the default component extensions. |
| 69 void AddDefaultComponentExtensions(); | 73 void AddDefaultComponentExtensions(); |
| 70 | 74 |
| 71 static void RegisterUserPrefs(PrefService* prefs); | 75 static void RegisterUserPrefs(PrefService* prefs); |
| 72 | 76 |
| 73 // Parse the given JSON manifest. Returns NULL if it cannot be parsed, or if | 77 // Parse the given JSON manifest. Returns NULL if it cannot be parsed, or if |
| 74 // if the result is not a DictionaryValue. | 78 // if the result is not a DictionaryValue. |
| 75 DictionaryValue* ParseManifest(const std::string& manifest_contents) const; | 79 DictionaryValue* ParseManifest(const std::string& manifest_contents) const; |
| 76 | 80 |
| 77 // Clear the list of registered extensions. | 81 // Clear the list of registered extensions. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 102 // The component extension's ID. | 106 // The component extension's ID. |
| 103 std::string extension_id; | 107 std::string extension_id; |
| 104 }; | 108 }; |
| 105 | 109 |
| 106 std::string Add(const DictionaryValue* parsed_manifest, | 110 std::string Add(const DictionaryValue* parsed_manifest, |
| 107 const FilePath& root_directory); | 111 const FilePath& root_directory); |
| 108 | 112 |
| 109 // Loads a registered component extension. | 113 // Loads a registered component extension. |
| 110 const Extension* Load(const ComponentExtensionInfo& info); | 114 const Extension* Load(const ComponentExtensionInfo& info); |
| 111 | 115 |
| 116 void AddDefaultComponentExtensionsWithBackgroundPages(); |
| 112 void AddFileManagerExtension(); | 117 void AddFileManagerExtension(); |
| 113 | 118 |
| 114 #if defined(OS_CHROMEOS) | 119 #if defined(OS_CHROMEOS) |
| 115 void AddGaiaAuthExtension(); | 120 void AddGaiaAuthExtension(); |
| 116 #endif | 121 #endif |
| 117 | 122 |
| 118 // Add the enterprise webstore extension, or reload it if already loaded. | 123 // Add the enterprise webstore extension, or reload it if already loaded. |
| 119 void AddOrReloadEnterpriseWebStore(); | 124 void AddOrReloadEnterpriseWebStore(); |
| 120 | 125 |
| 121 void AddChromeApp(); | 126 void AddChromeApp(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 132 PrefChangeRegistrar pref_change_registrar_; | 137 PrefChangeRegistrar pref_change_registrar_; |
| 133 | 138 |
| 134 std::string script_bubble_id_; | 139 std::string script_bubble_id_; |
| 135 | 140 |
| 136 DISALLOW_COPY_AND_ASSIGN(ComponentLoader); | 141 DISALLOW_COPY_AND_ASSIGN(ComponentLoader); |
| 137 }; | 142 }; |
| 138 | 143 |
| 139 } // namespace extensions | 144 } // namespace extensions |
| 140 | 145 |
| 141 #endif // CHROME_BROWSER_EXTENSIONS_COMPONENT_LOADER_H_ | 146 #endif // CHROME_BROWSER_EXTENSIONS_COMPONENT_LOADER_H_ |
| OLD | NEW |