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_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 <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 // Sets the |extension|'s active permissions to |permissions|. | 315 // Sets the |extension|'s active permissions to |permissions|. |
316 void UpdateActivePermissions(const Extension* extension, | 316 void UpdateActivePermissions(const Extension* extension, |
317 const ExtensionPermissionSet* permissions); | 317 const ExtensionPermissionSet* permissions); |
318 | 318 |
319 // Check for updates (or potentially new extensions from external providers) | 319 // Check for updates (or potentially new extensions from external providers) |
320 void CheckForExternalUpdates(); | 320 void CheckForExternalUpdates(); |
321 | 321 |
322 // Unload the specified extension. | 322 // Unload the specified extension. |
323 virtual void UnloadExtension( | 323 virtual void UnloadExtension( |
324 const std::string& extension_id, | 324 const std::string& extension_id, |
325 extension_misc::UnloadedExtensionReason reason); | 325 extension_misc::UnloadedExtensionReason reason) OVERRIDE; |
326 | 326 |
327 // Unload all extensions. This is currently only called on shutdown, and | 327 // Unload all extensions. This is currently only called on shutdown, and |
328 // does not send notifications. | 328 // does not send notifications. |
329 void UnloadAllExtensions(); | 329 void UnloadAllExtensions(); |
330 | 330 |
331 // Called only by testing. | 331 // Called only by testing. |
332 void ReloadExtensions(); | 332 void ReloadExtensions(); |
333 | 333 |
334 // Scan the extension directory and clean up the cruft. | 334 // Scan the extension directory and clean up the cruft. |
335 void GarbageCollectExtensions(); | 335 void GarbageCollectExtensions(); |
(...skipping 26 matching lines...) Expand all Loading... |
362 // Returns the icon to display in the omnibox popup window for the given | 362 // Returns the icon to display in the omnibox popup window for the given |
363 // extension. | 363 // extension. |
364 const SkBitmap& GetOmniboxPopupIcon(const std::string& extension_id); | 364 const SkBitmap& GetOmniboxPopupIcon(const std::string& extension_id); |
365 | 365 |
366 // Called when the initial extensions load has completed. | 366 // Called when the initial extensions load has completed. |
367 virtual void OnLoadedInstalledExtensions(); | 367 virtual void OnLoadedInstalledExtensions(); |
368 | 368 |
369 // Adds |extension| to this ExtensionService and notifies observers than an | 369 // Adds |extension| to this ExtensionService and notifies observers than an |
370 // extension has been loaded. Called by the backend after an extension has | 370 // extension has been loaded. Called by the backend after an extension has |
371 // been loaded from a file and installed. | 371 // been loaded from a file and installed. |
372 virtual void AddExtension(const Extension* extension); | 372 virtual void AddExtension(const Extension* extension) OVERRIDE; |
373 | 373 |
374 // Called by the backend when an extension has been installed. | 374 // Called by the backend when an extension has been installed. |
375 void OnExtensionInstalled( | 375 void OnExtensionInstalled( |
376 const Extension* extension, bool from_webstore, int page_index); | 376 const Extension* extension, bool from_webstore, int page_index); |
377 | 377 |
378 // Initializes the |extension|'s active permission set and disables the | 378 // Initializes the |extension|'s active permission set and disables the |
379 // extension if the privilege level has increased (e.g., due to an upgrade). | 379 // extension if the privilege level has increased (e.g., due to an upgrade). |
380 void InitializePermissions(const Extension* extension); | 380 void InitializePermissions(const Extension* extension); |
381 | 381 |
382 // Go through each extensions in pref, unload blacklisted extensions | 382 // Go through each extensions in pref, unload blacklisted extensions |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 extensions::ProcessMap process_map_; | 803 extensions::ProcessMap process_map_; |
804 | 804 |
805 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 805 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
806 InstallAppsWithUnlimtedStorage); | 806 InstallAppsWithUnlimtedStorage); |
807 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 807 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
808 InstallAppsAndCheckStorageProtection); | 808 InstallAppsAndCheckStorageProtection); |
809 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 809 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
810 }; | 810 }; |
811 | 811 |
812 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 812 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
OLD | NEW |