OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 | 10 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 const content::NotificationSource& source, | 60 const content::NotificationSource& source, |
61 const content::NotificationDetails& details) OVERRIDE; | 61 const content::NotificationDetails& details) OVERRIDE; |
62 | 62 |
63 static void RegisterUserPrefs(PrefService* prefs); | 63 static void RegisterUserPrefs(PrefService* prefs); |
64 | 64 |
65 // Parse the given JSON manifest. Returns NULL if it cannot be parsed, or if | 65 // Parse the given JSON manifest. Returns NULL if it cannot be parsed, or if |
66 // if the result is not a DictionaryValue. | 66 // if the result is not a DictionaryValue. |
67 DictionaryValue* ParseManifest(const std::string& manifest_contents) const; | 67 DictionaryValue* ParseManifest(const std::string& manifest_contents) const; |
68 | 68 |
69 // Clear the list of registered extensions. | 69 // Clear the list of registered extensions. |
70 void ClearAllRegistered() { | 70 void ClearAllRegistered(); |
71 component_extensions_.clear(); | |
72 } | |
73 | 71 |
74 private: | 72 private: |
75 // Information about a registered component extension. | 73 // Information about a registered component extension. |
76 struct ComponentExtensionInfo { | 74 struct ComponentExtensionInfo { |
77 ComponentExtensionInfo(const DictionaryValue* manifest, | 75 ComponentExtensionInfo(const DictionaryValue* manifest, |
78 const FilePath& root_directory) | 76 const FilePath& root_directory) |
79 : manifest(manifest), | 77 : manifest(manifest), |
80 root_directory(root_directory) { | 78 root_directory(root_directory) { |
81 } | 79 } |
82 | 80 |
(...skipping 23 matching lines...) Expand all Loading... |
106 // List of registered component extensions (see Extension::Location). | 104 // List of registered component extensions (see Extension::Location). |
107 typedef std::vector<ComponentExtensionInfo> RegisteredComponentExtensions; | 105 typedef std::vector<ComponentExtensionInfo> RegisteredComponentExtensions; |
108 RegisteredComponentExtensions component_extensions_; | 106 RegisteredComponentExtensions component_extensions_; |
109 | 107 |
110 PrefChangeRegistrar pref_change_registrar_; | 108 PrefChangeRegistrar pref_change_registrar_; |
111 }; | 109 }; |
112 | 110 |
113 } // namespace extensions | 111 } // namespace extensions |
114 | 112 |
115 #endif // CHROME_BROWSER_EXTENSIONS_COMPONENT_LOADER_H_ | 113 #endif // CHROME_BROWSER_EXTENSIONS_COMPONENT_LOADER_H_ |
OLD | NEW |