Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Side by Side Diff: chrome/browser/extensions/component_loader.h

Issue 2212853002: Move ChromeVox loading out of ComponentLoader. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // Similar to above but adds the default component extensions for kiosk mode. 92 // Similar to above but adds the default component extensions for kiosk mode.
93 void AddDefaultComponentExtensionsForKioskMode(bool skip_session_components); 93 void AddDefaultComponentExtensionsForKioskMode(bool skip_session_components);
94 94
95 // Clear the list of registered extensions. 95 // Clear the list of registered extensions.
96 void ClearAllRegistered(); 96 void ClearAllRegistered();
97 97
98 // Reloads a registered component extension. 98 // Reloads a registered component extension.
99 void Reload(const std::string& extension_id); 99 void Reload(const std::string& extension_id);
100 100
101 #if defined(OS_CHROMEOS) 101 #if defined(OS_CHROMEOS)
102 // True if a user is logged in and this isn't a guest session.
103 static bool IsNormalSession();
104
105 // Adds an extension where the manifest file is stored on the file system.
106 // |manifest_filename| can be relative to the |root_directory|.
102 // Calls |done_cb|, if not a null callback, on success. 107 // Calls |done_cb|, if not a null callback, on success.
103 // NOTE: |done_cb| is not called if the component loader is shut down 108 // NOTE: |done_cb| is not called if the component loader is shut down
104 // during loading. 109 // during loading.
105 void AddChromeVoxExtension(const base::Closure& done_cb); 110 void AddWithManifestFile(
111 const base::FilePath::CharType* manifest_filename,
112 const base::FilePath& root_directory,
113 const char* extension_id,
114 const base::Closure& done_cb);
115
106 void AddChromeOsSpeechSynthesisExtension(); 116 void AddChromeOsSpeechSynthesisExtension();
107 #endif 117 #endif
108 118
109 void set_ignore_whitelist_for_testing(bool value) { 119 void set_ignore_whitelist_for_testing(bool value) {
110 ignore_whitelist_for_testing_ = value; 120 ignore_whitelist_for_testing_ = value;
111 } 121 }
112 122
113 private: 123 private:
114 FRIEND_TEST_ALL_PREFIXES(ComponentLoaderTest, ParseManifest); 124 FRIEND_TEST_ALL_PREFIXES(ComponentLoaderTest, ParseManifest);
115 125
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 scoped_refptr<const Extension> CreateExtension( 178 scoped_refptr<const Extension> CreateExtension(
169 const ComponentExtensionInfo& info, std::string* utf8_error); 179 const ComponentExtensionInfo& info, std::string* utf8_error);
170 180
171 // Unloads |component| from the memory. 181 // Unloads |component| from the memory.
172 void UnloadComponent(ComponentExtensionInfo* component); 182 void UnloadComponent(ComponentExtensionInfo* component);
173 183
174 // Enable HTML5 FileSystem for given component extension in Guest mode. 184 // Enable HTML5 FileSystem for given component extension in Guest mode.
175 void EnableFileSystemInGuestMode(const std::string& id); 185 void EnableFileSystemInGuestMode(const std::string& id);
176 186
177 #if defined(OS_CHROMEOS) 187 #if defined(OS_CHROMEOS)
178 // Adds an extension where the manifest file is stored on the file system.
179 // |manifest_filename| can be relative to the |root_directory|.
180 void AddWithManifestFile(
181 const base::FilePath::CharType* manifest_filename,
182 const base::FilePath& root_directory,
183 const char* extension_id,
184 const base::Closure& done_cb);
185
186 // Used as a reply callback by |AddWithManifestFile|. 188 // Used as a reply callback by |AddWithManifestFile|.
187 // Called with a |root_directory| and parsed |manifest| and invokes 189 // Called with a |root_directory| and parsed |manifest| and invokes
188 // |done_cb| after adding the extension. 190 // |done_cb| after adding the extension.
189 void FinishAddWithManifestFile( 191 void FinishAddWithManifestFile(
190 const base::FilePath& root_directory, 192 const base::FilePath& root_directory,
191 const char* extension_id, 193 const char* extension_id,
192 const base::Closure& done_cb, 194 const base::Closure& done_cb,
193 std::unique_ptr<base::DictionaryValue> manifest); 195 std::unique_ptr<base::DictionaryValue> manifest);
194 #endif 196 #endif
195 197
(...skipping 12 matching lines...) Expand all
208 base::WeakPtrFactory<ComponentLoader> weak_factory_; 210 base::WeakPtrFactory<ComponentLoader> weak_factory_;
209 211
210 friend class TtsApiTest; 212 friend class TtsApiTest;
211 213
212 DISALLOW_COPY_AND_ASSIGN(ComponentLoader); 214 DISALLOW_COPY_AND_ASSIGN(ComponentLoader);
213 }; 215 };
214 216
215 } // namespace extensions 217 } // namespace extensions
216 218
217 #endif // CHROME_BROWSER_EXTENSIONS_COMPONENT_LOADER_H_ 219 #endif // CHROME_BROWSER_EXTENSIONS_COMPONENT_LOADER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698