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_EXTENSION_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 bool write_to_prefs); | 295 bool write_to_prefs); |
296 | 296 |
297 // Check for updates (or potentially new extensions from external providers) | 297 // Check for updates (or potentially new extensions from external providers) |
298 void CheckForExternalUpdates(); | 298 void CheckForExternalUpdates(); |
299 | 299 |
300 // Copies the list of force-installed extensions from the user PrefService | 300 // Copies the list of force-installed extensions from the user PrefService |
301 // to ExternalPolicyExtensionProvider. | 301 // to ExternalPolicyExtensionProvider. |
302 void UpdateExternalPolicyExtensionProvider(); | 302 void UpdateExternalPolicyExtensionProvider(); |
303 | 303 |
304 // Unload the specified extension. | 304 // Unload the specified extension. |
305 void UnloadExtension(const std::string& extension_id); | 305 void UnloadExtension(const std::string& extension_id, |
| 306 UnloadedExtensionInfo::Reason reason); |
306 | 307 |
307 // Unload all extensions. This is currently only called on shutdown, and | 308 // Unload all extensions. This is currently only called on shutdown, and |
308 // does not send notifications. | 309 // does not send notifications. |
309 void UnloadAllExtensions(); | 310 void UnloadAllExtensions(); |
310 | 311 |
311 // Called only by testing. | 312 // Called only by testing. |
312 void ReloadExtensions(); | 313 void ReloadExtensions(); |
313 | 314 |
314 // Scan the extension directory and clean up the cruft. | 315 // Scan the extension directory and clean up the cruft. |
315 void GarbageCollectExtensions(); | 316 void GarbageCollectExtensions(); |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 const std::string& id, const GURL& update_url, | 474 const std::string& id, const GURL& update_url, |
474 ShouldInstallExtensionPredicate should_install_extension, | 475 ShouldInstallExtensionPredicate should_install_extension, |
475 bool is_from_sync, bool install_silently, | 476 bool is_from_sync, bool install_silently, |
476 bool enable_on_install, bool enable_incognito_on_install, | 477 bool enable_on_install, bool enable_incognito_on_install, |
477 Extension::Location install_source); | 478 Extension::Location install_source); |
478 | 479 |
479 // Handles sending notification that |extension| was loaded. | 480 // Handles sending notification that |extension| was loaded. |
480 void NotifyExtensionLoaded(const Extension* extension); | 481 void NotifyExtensionLoaded(const Extension* extension); |
481 | 482 |
482 // Handles sending notification that |extension| was unloaded. | 483 // Handles sending notification that |extension| was unloaded. |
483 void NotifyExtensionUnloaded(const Extension* extension); | 484 void NotifyExtensionUnloaded(const Extension* extension, |
| 485 UnloadedExtensionInfo::Reason reason); |
484 | 486 |
485 // Helper that updates the active extension list used for crash reporting. | 487 // Helper that updates the active extension list used for crash reporting. |
486 void UpdateActiveExtensionsInCrashReporter(); | 488 void UpdateActiveExtensionsInCrashReporter(); |
487 | 489 |
488 // Helper method. Loads extension from prefs. | 490 // Helper method. Loads extension from prefs. |
489 void LoadInstalledExtension(const ExtensionInfo& info, bool write_to_prefs); | 491 void LoadInstalledExtension(const ExtensionInfo& info, bool write_to_prefs); |
490 | 492 |
491 // Helper methods to configure the storage services accordingly. | 493 // Helper methods to configure the storage services accordingly. |
492 void GrantProtectedStorage(const Extension* extension); | 494 void GrantProtectedStorage(const Extension* extension); |
493 void RevokeProtectedStorage(const Extension* extension); | 495 void RevokeProtectedStorage(const Extension* extension); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 592 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
591 UpdatePendingExtensionAlreadyInstalled); | 593 UpdatePendingExtensionAlreadyInstalled); |
592 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 594 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
593 InstallAppsWithUnlimtedStorage); | 595 InstallAppsWithUnlimtedStorage); |
594 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 596 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
595 InstallAppsAndCheckStorageProtection); | 597 InstallAppsAndCheckStorageProtection); |
596 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 598 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
597 }; | 599 }; |
598 | 600 |
599 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 601 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
OLD | NEW |