OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_EXTENSIONS_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSIONS_SERVICE_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSIONS_SERVICE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSIONS_SERVICE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 // Getter for the extension's runtime data PropertyBag. | 212 // Getter for the extension's runtime data PropertyBag. |
213 PropertyBag* GetPropertyBag(const Extension* extension); | 213 PropertyBag* GetPropertyBag(const Extension* extension); |
214 | 214 |
215 // Initialize and start all installed extensions. | 215 // Initialize and start all installed extensions. |
216 void Init(); | 216 void Init(); |
217 | 217 |
218 // Start up the extension event routers. | 218 // Start up the extension event routers. |
219 void InitEventRouters(); | 219 void InitEventRouters(); |
220 | 220 |
221 // Look up an extension by ID. | 221 // Look up an extension by ID. |
222 const Extension* GetExtensionById(const std::string& id, | 222 virtual const Extension* GetExtensionById(const std::string& id, |
223 bool include_disabled) { | 223 bool include_disabled); |
224 return GetExtensionByIdInternal(id, true, include_disabled); | |
225 } | |
226 | 224 |
227 // Install the extension file at |extension_path|. Will install as an | 225 // Install the extension file at |extension_path|. Will install as an |
228 // update if an older version is already installed. | 226 // update if an older version is already installed. |
229 // For fresh installs, this method also causes the extension to be | 227 // For fresh installs, this method also causes the extension to be |
230 // immediately loaded. | 228 // immediately loaded. |
231 // TODO(aa): This method can be removed. It is only used by the unit tests, | 229 // TODO(aa): This method can be removed. It is only used by the unit tests, |
232 // and they could use CrxInstaller directly instead. | 230 // and they could use CrxInstaller directly instead. |
233 void InstallExtension(const FilePath& extension_path); | 231 void InstallExtension(const FilePath& extension_path); |
234 | 232 |
235 // Updates a currently-installed extension with the contents from | 233 // Updates a currently-installed extension with the contents from |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 bool show_extensions_prompts() { | 397 bool show_extensions_prompts() { |
400 return show_extensions_prompts_; | 398 return show_extensions_prompts_; |
401 } | 399 } |
402 | 400 |
403 Profile* profile() { return profile_; } | 401 Profile* profile() { return profile_; } |
404 | 402 |
405 // Profile calls this when it is being destroyed so that we know not to call | 403 // Profile calls this when it is being destroyed so that we know not to call |
406 // it. | 404 // it. |
407 void DestroyingProfile(); | 405 void DestroyingProfile(); |
408 | 406 |
409 ExtensionPrefs* extension_prefs() { return extension_prefs_; } | 407 virtual ExtensionPrefs* extension_prefs() { return extension_prefs_; } |
410 | 408 |
411 // Whether the extension service is ready. | 409 // Whether the extension service is ready. |
412 // TODO(skerner): Get rid of this method. crbug.com/63756 | 410 // TODO(skerner): Get rid of this method. crbug.com/63756 |
413 bool is_ready() { return ready_; } | 411 bool is_ready() { return ready_; } |
414 | 412 |
415 // Note that this may return NULL if autoupdate is not turned on. | 413 // Note that this may return NULL if autoupdate is not turned on. |
416 ExtensionUpdater* updater() { return updater_.get(); } | 414 ExtensionUpdater* updater() { return updater_.get(); } |
417 | 415 |
418 ExtensionToolbarModel* toolbar_model() { return &toolbar_model_; } | 416 ExtensionToolbarModel* toolbar_model() { return &toolbar_model_; } |
419 | 417 |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 FRIEND_TEST_ALL_PREFIXES(ExtensionsServiceTest, | 600 FRIEND_TEST_ALL_PREFIXES(ExtensionsServiceTest, |
603 UpdatePendingExtensionAlreadyInstalled); | 601 UpdatePendingExtensionAlreadyInstalled); |
604 FRIEND_TEST_ALL_PREFIXES(ExtensionsServiceTest, | 602 FRIEND_TEST_ALL_PREFIXES(ExtensionsServiceTest, |
605 InstallAppsWithUnlimtedStorage); | 603 InstallAppsWithUnlimtedStorage); |
606 FRIEND_TEST_ALL_PREFIXES(ExtensionsServiceTest, | 604 FRIEND_TEST_ALL_PREFIXES(ExtensionsServiceTest, |
607 InstallAppsAndCheckStorageProtection); | 605 InstallAppsAndCheckStorageProtection); |
608 DISALLOW_COPY_AND_ASSIGN(ExtensionsService); | 606 DISALLOW_COPY_AND_ASSIGN(ExtensionsService); |
609 }; | 607 }; |
610 | 608 |
611 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSIONS_SERVICE_H_ | 609 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSIONS_SERVICE_H_ |
OLD | NEW |