| 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 <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 class AppNotificationManager; | 47 class AppNotificationManager; |
| 48 class BookmarkExtensionEventRouter; | 48 class BookmarkExtensionEventRouter; |
| 49 class CrxInstaller; | 49 class CrxInstaller; |
| 50 class ExtensionBrowserEventRouter; | 50 class ExtensionBrowserEventRouter; |
| 51 class ExtensionContentSettingsStore; | 51 class ExtensionContentSettingsStore; |
| 52 class ExtensionCookiesEventRouter; | 52 class ExtensionCookiesEventRouter; |
| 53 class ExtensionDownloadsEventRouter; | 53 class ExtensionDownloadsEventRouter; |
| 54 class ExtensionFileBrowserEventRouter; | 54 class ExtensionFileBrowserEventRouter; |
| 55 class ExtensionGlobalError; | 55 class ExtensionGlobalError; |
| 56 class HistoryExtensionEventRouter; | |
| 57 class ExtensionInstallUI; | 56 class ExtensionInstallUI; |
| 58 class ExtensionManagementEventRouter; | 57 class ExtensionManagementEventRouter; |
| 59 class ExtensionPreferenceEventRouter; | 58 class ExtensionPreferenceEventRouter; |
| 60 class ExtensionServiceBackend; | |
| 61 class ExtensionSyncData; | 59 class ExtensionSyncData; |
| 62 class ExtensionToolbarModel; | 60 class ExtensionToolbarModel; |
| 63 class ExtensionUpdater; | 61 class ExtensionUpdater; |
| 64 class ExtensionWebNavigationEventRouter; | 62 class ExtensionWebNavigationEventRouter; |
| 63 class HistoryExtensionEventRouter; |
| 65 class GURL; | 64 class GURL; |
| 66 class PendingExtensionManager; | 65 class PendingExtensionManager; |
| 67 class Profile; | 66 class Profile; |
| 68 class SyncData; | 67 class SyncData; |
| 69 class Version; | 68 class Version; |
| 70 | 69 |
| 71 namespace chromeos { | 70 namespace chromeos { |
| 72 class ExtensionInputMethodEventRouter; | 71 class ExtensionInputMethodEventRouter; |
| 73 } // namespace chromeos | 72 } |
| 73 |
| 74 namespace extensions { |
| 75 class ComponentLoader; |
| 76 } |
| 74 | 77 |
| 75 // This is an interface class to encapsulate the dependencies that | 78 // This is an interface class to encapsulate the dependencies that |
| 76 // various classes have on ExtensionService. This allows easy mocking. | 79 // various classes have on ExtensionService. This allows easy mocking. |
| 77 class ExtensionServiceInterface : public SyncableService { | 80 class ExtensionServiceInterface : public SyncableService { |
| 78 public: | 81 public: |
| 79 // A function that returns true if the given extension should be | 82 // A function that returns true if the given extension should be |
| 80 // included and false if it should be filtered out. Identical to | 83 // included and false if it should be filtered out. Identical to |
| 81 // PendingExtensionInfo::ShouldAllowInstallPredicate. | 84 // PendingExtensionInfo::ShouldAllowInstallPredicate. |
| 82 typedef bool (*ExtensionFilter)(const Extension&); | 85 typedef bool (*ExtensionFilter)(const Extension&); |
| 83 | 86 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 109 // | 112 // |
| 110 // TODO(akalin): Remove this method (and others) once we refactor | 113 // TODO(akalin): Remove this method (and others) once we refactor |
| 111 // themes sync to not use it directly. | 114 // themes sync to not use it directly. |
| 112 virtual void CheckForUpdatesSoon() = 0; | 115 virtual void CheckForUpdatesSoon() = 0; |
| 113 }; | 116 }; |
| 114 | 117 |
| 115 // Manages installed and running Chromium extensions. | 118 // Manages installed and running Chromium extensions. |
| 116 class ExtensionService | 119 class ExtensionService |
| 117 : public ExtensionServiceInterface, | 120 : public ExtensionServiceInterface, |
| 118 public ExternalExtensionProviderInterface::VisitorInterface, | 121 public ExternalExtensionProviderInterface::VisitorInterface, |
| 122 public base::SupportsWeakPtr<ExtensionService>, |
| 119 public content::NotificationObserver { | 123 public content::NotificationObserver { |
| 120 public: | 124 public: |
| 121 // Information about a registered component extension. | 125 using base::SupportsWeakPtr<ExtensionService>::AsWeakPtr; |
| 122 struct ComponentExtensionInfo { | |
| 123 ComponentExtensionInfo(const std::string& manifest, | |
| 124 const FilePath& root_directory) | |
| 125 : manifest(manifest), | |
| 126 root_directory(root_directory) { | |
| 127 } | |
| 128 | |
| 129 bool Equals(const ComponentExtensionInfo& other) const; | |
| 130 | |
| 131 // The extension's manifest. This is required for component extensions so | |
| 132 // that ExtensionService doesn't need to go to disk to load them. | |
| 133 std::string manifest; | |
| 134 | |
| 135 // Directory where the extension is stored. | |
| 136 FilePath root_directory; | |
| 137 }; | |
| 138 | 126 |
| 139 // The name of the directory inside the profile where extensions are | 127 // The name of the directory inside the profile where extensions are |
| 140 // installed to. | 128 // installed to. |
| 141 static const char* kInstallDirectoryName; | 129 static const char* kInstallDirectoryName; |
| 142 | 130 |
| 143 // If auto-updates are turned on, default to running every 5 hours. | 131 // If auto-updates are turned on, default to running every 5 hours. |
| 144 static const int kDefaultUpdateFrequencySeconds = 60 * 60 * 5; | 132 static const int kDefaultUpdateFrequencySeconds = 60 * 60 * 5; |
| 145 | 133 |
| 146 // The name of the directory inside the profile where per-extension settings | 134 // The name of the directory inside the profile where per-extension settings |
| 147 // are stored. | 135 // are stored. |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 virtual ~ExtensionService(); | 175 virtual ~ExtensionService(); |
| 188 | 176 |
| 189 // Gets the list of currently installed extensions. | 177 // Gets the list of currently installed extensions. |
| 190 virtual const ExtensionList* extensions() const OVERRIDE; | 178 virtual const ExtensionList* extensions() const OVERRIDE; |
| 191 const ExtensionList* disabled_extensions() const; | 179 const ExtensionList* disabled_extensions() const; |
| 192 const ExtensionList* terminated_extensions() const; | 180 const ExtensionList* terminated_extensions() const; |
| 193 | 181 |
| 194 // Gets the object managing the set of pending extensions. | 182 // Gets the object managing the set of pending extensions. |
| 195 virtual PendingExtensionManager* pending_extension_manager() OVERRIDE; | 183 virtual PendingExtensionManager* pending_extension_manager() OVERRIDE; |
| 196 | 184 |
| 197 // Registers an extension to be loaded as a component extension. | |
| 198 void register_component_extension(const ComponentExtensionInfo& info) { | |
| 199 component_extension_manifests_.push_back(info); | |
| 200 } | |
| 201 | |
| 202 // Unregisters a component extension from the list of extensions to be loaded | |
| 203 void UnregisterComponentExtension(const ComponentExtensionInfo& info); | |
| 204 | |
| 205 const FilePath& install_directory() const { return install_directory_; } | 185 const FilePath& install_directory() const { return install_directory_; } |
| 206 | 186 |
| 207 AppsPromo* apps_promo() { return &apps_promo_; } | 187 AppsPromo* apps_promo() { return &apps_promo_; } |
| 208 | 188 |
| 209 // Whether this extension can run in an incognito window. | 189 // Whether this extension can run in an incognito window. |
| 210 virtual bool IsIncognitoEnabled(const std::string& extension_id) const; | 190 virtual bool IsIncognitoEnabled(const std::string& extension_id) const; |
| 211 virtual void SetIsIncognitoEnabled(const std::string& extension_id, | 191 virtual void SetIsIncognitoEnabled(const std::string& extension_id, |
| 212 bool enabled); | 192 bool enabled); |
| 213 | 193 |
| 214 virtual void SetAppNotificationSetupDone(const std::string& extension_id, | 194 virtual void SetAppNotificationSetupDone(const std::string& extension_id, |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 | 298 |
| 319 // Updates the |extension|'s granted permissions lists to include all | 299 // Updates the |extension|'s granted permissions lists to include all |
| 320 // permissions in the |extension|'s manifest and re-enables the | 300 // permissions in the |extension|'s manifest and re-enables the |
| 321 // extension. | 301 // extension. |
| 322 void GrantPermissionsAndEnableExtension(const Extension* extension); | 302 void GrantPermissionsAndEnableExtension(const Extension* extension); |
| 323 | 303 |
| 324 // Sets the |extension|'s active permissions to |permissions|. | 304 // Sets the |extension|'s active permissions to |permissions|. |
| 325 void UpdateActivePermissions(const Extension* extension, | 305 void UpdateActivePermissions(const Extension* extension, |
| 326 const ExtensionPermissionSet* permissions); | 306 const ExtensionPermissionSet* permissions); |
| 327 | 307 |
| 328 // Loads the extension from the directory |extension_path|. | |
| 329 void LoadExtension(const FilePath& extension_path); | |
| 330 | |
| 331 // Loads the extension from the directory |extension_path|. | |
| 332 // This version of this method is intended for testing only. | |
| 333 void LoadExtension(const FilePath& extension_path, bool prompt_for_plugins); | |
| 334 | |
| 335 // Same as above, but for use with command line switch --load-extension=path. | |
| 336 void LoadExtensionFromCommandLine(const FilePath& extension_path); | |
| 337 | |
| 338 // Loads any component extensions. | |
| 339 void LoadComponentExtensions(); | |
| 340 | |
| 341 // Loads particular component extension. | |
| 342 const Extension* LoadComponentExtension(const ComponentExtensionInfo& info); | |
| 343 | |
| 344 // Unloads particular component extension. | |
| 345 void UnloadComponentExtension(const ComponentExtensionInfo& info); | |
| 346 | |
| 347 // Loads all known extensions (used by startup and testing code). | |
| 348 void LoadAllExtensions(); | |
| 349 | |
| 350 // Check for updates (or potentially new extensions from external providers) | 308 // Check for updates (or potentially new extensions from external providers) |
| 351 void CheckForExternalUpdates(); | 309 void CheckForExternalUpdates(); |
| 352 | 310 |
| 353 // Unload the specified extension. | 311 // Unload the specified extension. |
| 354 void UnloadExtension(const std::string& extension_id, | 312 void UnloadExtension(const std::string& extension_id, |
| 355 extension_misc::UnloadedExtensionReason reason); | 313 extension_misc::UnloadedExtensionReason reason); |
| 356 | 314 |
| 357 // Unload all extensions. This is currently only called on shutdown, and | 315 // Unload all extensions. This is currently only called on shutdown, and |
| 358 // does not send notifications. | 316 // does not send notifications. |
| 359 void UnloadAllExtensions(); | 317 void UnloadAllExtensions(); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 const SkBitmap& GetOmniboxPopupIcon(const std::string& extension_id); | 352 const SkBitmap& GetOmniboxPopupIcon(const std::string& extension_id); |
| 395 | 353 |
| 396 // Called when the initial extensions load has completed. | 354 // Called when the initial extensions load has completed. |
| 397 virtual void OnLoadedInstalledExtensions(); | 355 virtual void OnLoadedInstalledExtensions(); |
| 398 | 356 |
| 399 // Adds |extension| to this ExtensionService and notifies observers than an | 357 // Adds |extension| to this ExtensionService and notifies observers than an |
| 400 // extension has been loaded. Called by the backend after an extension has | 358 // extension has been loaded. Called by the backend after an extension has |
| 401 // been loaded from a file and installed. | 359 // been loaded from a file and installed. |
| 402 void AddExtension(const Extension* extension); | 360 void AddExtension(const Extension* extension); |
| 403 | 361 |
| 404 // Called by the backend when an unpacked extension has been loaded. | |
| 405 void OnLoadSingleExtension(const Extension* extension, | |
| 406 bool prompt_for_plugins); | |
| 407 | |
| 408 // Called by the backend when an extension has been installed. | 362 // Called by the backend when an extension has been installed. |
| 409 void OnExtensionInstalled( | 363 void OnExtensionInstalled( |
| 410 const Extension* extension, bool from_webstore, int page_index); | 364 const Extension* extension, bool from_webstore, int page_index); |
| 411 | 365 |
| 412 // Initializes the |extension|'s active permission set and disables the | 366 // Initializes the |extension|'s active permission set and disables the |
| 413 // extension if the privilege level has increased (e.g., due to an upgrade). | 367 // extension if the privilege level has increased (e.g., due to an upgrade). |
| 414 void InitializePermissions(const Extension* extension); | 368 void InitializePermissions(const Extension* extension); |
| 415 | 369 |
| 416 // Go through each extensions in pref, unload blacklisted extensions | 370 // Go through each extensions in pref, unload blacklisted extensions |
| 417 // and update the blacklist state in pref. | 371 // and update the blacklist state in pref. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 | 405 |
| 452 // TODO(skerner): Change to const ExtensionPrefs& extension_prefs() const, | 406 // TODO(skerner): Change to const ExtensionPrefs& extension_prefs() const, |
| 453 // ExtensionPrefs* mutable_extension_prefs(). | 407 // ExtensionPrefs* mutable_extension_prefs(). |
| 454 ExtensionPrefs* extension_prefs(); | 408 ExtensionPrefs* extension_prefs(); |
| 455 | 409 |
| 456 ExtensionSettingsFrontend* extension_settings_frontend(); | 410 ExtensionSettingsFrontend* extension_settings_frontend(); |
| 457 | 411 |
| 458 ExtensionContentSettingsStore* GetExtensionContentSettingsStore(); | 412 ExtensionContentSettingsStore* GetExtensionContentSettingsStore(); |
| 459 | 413 |
| 460 // Whether the extension service is ready. | 414 // Whether the extension service is ready. |
| 461 // TODO(skerner): Get rid of this method. crbug.com/63756 | |
| 462 bool is_ready() { return ready_; } | 415 bool is_ready() { return ready_; } |
| 463 | 416 |
| 417 extensions::ComponentLoader* component_loader() { |
| 418 return component_loader_.get(); |
| 419 } |
| 420 |
| 464 // Note that this may return NULL if autoupdate is not turned on. | 421 // Note that this may return NULL if autoupdate is not turned on. |
| 465 ExtensionUpdater* updater(); | 422 ExtensionUpdater* updater(); |
| 466 | 423 |
| 467 ExtensionToolbarModel* toolbar_model() { return &toolbar_model_; } | 424 ExtensionToolbarModel* toolbar_model() { return &toolbar_model_; } |
| 468 | 425 |
| 469 ExtensionsQuotaService* quota_service() { return "a_service_; } | 426 ExtensionsQuotaService* quota_service() { return "a_service_; } |
| 470 | 427 |
| 471 ExtensionMenuManager* menu_manager() { return &menu_manager_; } | 428 ExtensionMenuManager* menu_manager() { return &menu_manager_; } |
| 472 | 429 |
| 473 AppNotificationManager* app_notification_manager() { | 430 AppNotificationManager* app_notification_manager() { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 485 #if defined(OS_CHROMEOS) | 442 #if defined(OS_CHROMEOS) |
| 486 ExtensionFileBrowserEventRouter* file_browser_event_router() { | 443 ExtensionFileBrowserEventRouter* file_browser_event_router() { |
| 487 return file_browser_event_router_.get(); | 444 return file_browser_event_router_.get(); |
| 488 } | 445 } |
| 489 chromeos::ExtensionInputMethodEventRouter* input_method_event_router() { | 446 chromeos::ExtensionInputMethodEventRouter* input_method_event_router() { |
| 490 return input_method_event_router_.get(); | 447 return input_method_event_router_.get(); |
| 491 } | 448 } |
| 492 #endif | 449 #endif |
| 493 | 450 |
| 494 // Notify the frontend that there was an error loading an extension. | 451 // Notify the frontend that there was an error loading an extension. |
| 495 // This method is public because ExtensionServiceBackend can post to here. | 452 // This method is public because UnpackedInstaller and InstalledLoader |
| 453 // can post to here. |
| 454 // TODO(aa): Remove this. It doesn't do enough to be worth the dependency |
| 455 // of these classes on ExtensionService. |
| 496 void ReportExtensionLoadError(const FilePath& extension_path, | 456 void ReportExtensionLoadError(const FilePath& extension_path, |
| 497 const std::string& error, | 457 const std::string& error, |
| 498 bool be_noisy); | 458 bool be_noisy); |
| 499 | 459 |
| 500 // ExtensionHost of background page calls this method right after its render | 460 // ExtensionHost of background page calls this method right after its render |
| 501 // view has been created. | 461 // view has been created. |
| 502 void DidCreateRenderViewForBackgroundPage(ExtensionHost* host); | 462 void DidCreateRenderViewForBackgroundPage(ExtensionHost* host); |
| 503 | 463 |
| 504 // For the extension in |version_path| with |id|, check to see if it's an | 464 // For the extension in |version_path| with |id|, check to see if it's an |
| 505 // externally managed extension. If so, uninstall it. | 465 // externally managed extension. If so, uninstall it. |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 // Gets the set of loaded app ids. Component apps are not included. | 518 // Gets the set of loaded app ids. Component apps are not included. |
| 559 ExtensionIdSet GetAppIds() const; | 519 ExtensionIdSet GetAppIds() const; |
| 560 | 520 |
| 561 // Record a histogram using the PermissionMessage enum values for each | 521 // Record a histogram using the PermissionMessage enum values for each |
| 562 // permission in |e|. | 522 // permission in |e|. |
| 563 // NOTE: If this is ever called with high frequency, the implementation may | 523 // NOTE: If this is ever called with high frequency, the implementation may |
| 564 // need to be made more efficient. | 524 // need to be made more efficient. |
| 565 static void RecordPermissionMessagesHistogram( | 525 static void RecordPermissionMessagesHistogram( |
| 566 const Extension* e, const char* histogram); | 526 const Extension* e, const char* histogram); |
| 567 | 527 |
| 568 // |client| can be NULL for a silent install. | |
| 569 scoped_refptr<CrxInstaller> MakeCrxInstaller(ExtensionInstallUI* client); | |
| 570 | |
| 571 #if defined(UNIT_TEST) | 528 #if defined(UNIT_TEST) |
| 572 void TrackTerminatedExtensionForTest(const Extension* extension) { | 529 void TrackTerminatedExtensionForTest(const Extension* extension) { |
| 573 TrackTerminatedExtension(extension); | 530 TrackTerminatedExtension(extension); |
| 574 } | 531 } |
| 575 #endif | 532 #endif |
| 576 | 533 |
| 577 ExtensionWarningSet* extension_warnings() { | 534 ExtensionWarningSet* extension_warnings() { |
| 578 return &extension_warnings_; | 535 return &extension_warnings_; |
| 579 } | 536 } |
| 580 | 537 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 // Handles sending notification that |extension| was loaded. | 629 // Handles sending notification that |extension| was loaded. |
| 673 void NotifyExtensionLoaded(const Extension* extension); | 630 void NotifyExtensionLoaded(const Extension* extension); |
| 674 | 631 |
| 675 // Handles sending notification that |extension| was unloaded. | 632 // Handles sending notification that |extension| was unloaded. |
| 676 void NotifyExtensionUnloaded(const Extension* extension, | 633 void NotifyExtensionUnloaded(const Extension* extension, |
| 677 extension_misc::UnloadedExtensionReason reason); | 634 extension_misc::UnloadedExtensionReason reason); |
| 678 | 635 |
| 679 // Helper that updates the active extension list used for crash reporting. | 636 // Helper that updates the active extension list used for crash reporting. |
| 680 void UpdateActiveExtensionsInCrashReporter(); | 637 void UpdateActiveExtensionsInCrashReporter(); |
| 681 | 638 |
| 682 // Helper method. Loads extension from prefs. | |
| 683 void LoadInstalledExtension(const ExtensionInfo& info, bool write_to_prefs); | |
| 684 | |
| 685 // We implement some Pepper plug-ins using NaCl to take advantage of NaCl's | 639 // We implement some Pepper plug-ins using NaCl to take advantage of NaCl's |
| 686 // strong sandbox. Typically, these NaCl modules are stored in extensions | 640 // strong sandbox. Typically, these NaCl modules are stored in extensions |
| 687 // and registered here. Not all NaCl modules need to register for a MIME | 641 // and registered here. Not all NaCl modules need to register for a MIME |
| 688 // type, just the ones that are responsible for rendering a particular MIME | 642 // type, just the ones that are responsible for rendering a particular MIME |
| 689 // type, like application/pdf. Note: We only register NaCl modules in the | 643 // type, like application/pdf. Note: We only register NaCl modules in the |
| 690 // browser process. | 644 // browser process. |
| 691 void RegisterNaClModule(const GURL& url, const std::string& mime_type); | 645 void RegisterNaClModule(const GURL& url, const std::string& mime_type); |
| 692 void UnregisterNaClModule(const GURL& url); | 646 void UnregisterNaClModule(const GURL& url); |
| 693 | 647 |
| 694 // Call UpdatePluginListWithNaClModules() after registering or unregistering | 648 // Call UpdatePluginListWithNaClModules() after registering or unregistering |
| 695 // a NaCl module to see those changes reflected in the PluginList. | 649 // a NaCl module to see those changes reflected in the PluginList. |
| 696 void UpdatePluginListWithNaClModules(); | 650 void UpdatePluginListWithNaClModules(); |
| 697 | 651 |
| 698 NaClModuleInfoList::iterator FindNaClModule(const GURL& url); | 652 NaClModuleInfoList::iterator FindNaClModule(const GURL& url); |
| 699 | 653 |
| 700 // Returns the flags that should be used with Extension::Create() for an | |
| 701 // extension that is already installed. | |
| 702 int GetExtensionCreateFlagsForInstalledExtension( | |
| 703 const ExtensionInfo* info); | |
| 704 | |
| 705 base::WeakPtrFactory<ExtensionService> weak_ptr_factory_; | |
| 706 | |
| 707 // The profile this ExtensionService is part of. | 654 // The profile this ExtensionService is part of. |
| 708 Profile* profile_; | 655 Profile* profile_; |
| 709 | 656 |
| 710 // Preferences for the owning profile (weak reference). | 657 // Preferences for the owning profile (weak reference). |
| 711 ExtensionPrefs* extension_prefs_; | 658 ExtensionPrefs* extension_prefs_; |
| 712 | 659 |
| 713 // Settings for the owning profile. | 660 // Settings for the owning profile. |
| 714 ExtensionSettingsFrontend extension_settings_frontend_; | 661 ExtensionSettingsFrontend extension_settings_frontend_; |
| 715 | 662 |
| 716 // The current list of installed extensions. | 663 // The current list of installed extensions. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 739 | 686 |
| 740 // The full path to the directory where extensions are installed. | 687 // The full path to the directory where extensions are installed. |
| 741 FilePath install_directory_; | 688 FilePath install_directory_; |
| 742 | 689 |
| 743 // Whether or not extensions are enabled. | 690 // Whether or not extensions are enabled. |
| 744 bool extensions_enabled_; | 691 bool extensions_enabled_; |
| 745 | 692 |
| 746 // Whether to notify users when they attempt to install an extension. | 693 // Whether to notify users when they attempt to install an extension. |
| 747 bool show_extensions_prompts_; | 694 bool show_extensions_prompts_; |
| 748 | 695 |
| 749 // The backend that will do IO on behalf of this instance. | |
| 750 scoped_refptr<ExtensionServiceBackend> backend_; | |
| 751 | |
| 752 // Used by dispatchers to limit API quota for individual extensions. | 696 // Used by dispatchers to limit API quota for individual extensions. |
| 753 ExtensionsQuotaService quota_service_; | 697 ExtensionsQuotaService quota_service_; |
| 754 | 698 |
| 755 // Record that Init() has been called, and chrome::EXTENSIONS_READY | 699 // Record that Init() has been called, and chrome::EXTENSIONS_READY |
| 756 // has fired. | 700 // has fired. |
| 757 bool ready_; | 701 bool ready_; |
| 758 | 702 |
| 759 // Our extension updater, if updates are turned on. | 703 // Our extension updater, if updates are turned on. |
| 760 scoped_ptr<ExtensionUpdater> updater_; | 704 scoped_ptr<ExtensionUpdater> updater_; |
| 761 | 705 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 775 DisabledExtensionPathMap disabled_extension_paths_; | 719 DisabledExtensionPathMap disabled_extension_paths_; |
| 776 | 720 |
| 777 // Map of inspector cookies that are detached, waiting for an extension to be | 721 // Map of inspector cookies that are detached, waiting for an extension to be |
| 778 // reloaded. | 722 // reloaded. |
| 779 typedef std::map<std::string, int> OrphanedDevTools; | 723 typedef std::map<std::string, int> OrphanedDevTools; |
| 780 OrphanedDevTools orphaned_dev_tools_; | 724 OrphanedDevTools orphaned_dev_tools_; |
| 781 | 725 |
| 782 content::NotificationRegistrar registrar_; | 726 content::NotificationRegistrar registrar_; |
| 783 PrefChangeRegistrar pref_change_registrar_; | 727 PrefChangeRegistrar pref_change_registrar_; |
| 784 | 728 |
| 729 // Keeps track of loading and unloading component extensions. |
| 730 scoped_ptr<extensions::ComponentLoader> component_loader_; |
| 731 |
| 785 // Keeps track of menu items added by extensions. | 732 // Keeps track of menu items added by extensions. |
| 786 ExtensionMenuManager menu_manager_; | 733 ExtensionMenuManager menu_manager_; |
| 787 | 734 |
| 788 // Keeps track of app notifications. | 735 // Keeps track of app notifications. |
| 789 scoped_refptr<AppNotificationManager> app_notification_manager_; | 736 scoped_refptr<AppNotificationManager> app_notification_manager_; |
| 790 | 737 |
| 791 // Keeps track of extension permissions. | 738 // Keeps track of extension permissions. |
| 792 ExtensionPermissionsManager permissions_manager_; | 739 ExtensionPermissionsManager permissions_manager_; |
| 793 | 740 |
| 794 // Keeps track of favicon-sized omnibox icons for extensions. | 741 // Keeps track of favicon-sized omnibox icons for extensions. |
| 795 ExtensionIconManager omnibox_icon_manager_; | 742 ExtensionIconManager omnibox_icon_manager_; |
| 796 ExtensionIconManager omnibox_popup_icon_manager_; | 743 ExtensionIconManager omnibox_popup_icon_manager_; |
| 797 | 744 |
| 798 // List of registered component extensions (see Extension::Location). | |
| 799 typedef std::vector<ComponentExtensionInfo> RegisteredComponentExtensions; | |
| 800 RegisteredComponentExtensions component_extension_manifests_; | |
| 801 | |
| 802 // Manages the promotion of the web store. | 745 // Manages the promotion of the web store. |
| 803 AppsPromo apps_promo_; | 746 AppsPromo apps_promo_; |
| 804 | 747 |
| 805 // Flag to make sure event routers are only initialized once. | 748 // Flag to make sure event routers are only initialized once. |
| 806 bool event_routers_initialized_; | 749 bool event_routers_initialized_; |
| 807 | 750 |
| 808 scoped_ptr<ExtensionDownloadsEventRouter> downloads_event_router_; | 751 scoped_ptr<ExtensionDownloadsEventRouter> downloads_event_router_; |
| 809 | 752 |
| 810 scoped_ptr<HistoryExtensionEventRouter> history_event_router_; | 753 scoped_ptr<HistoryExtensionEventRouter> history_event_router_; |
| 811 | 754 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 846 ExtensionWarningSet extension_warnings_; | 789 ExtensionWarningSet extension_warnings_; |
| 847 | 790 |
| 848 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 791 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
| 849 InstallAppsWithUnlimtedStorage); | 792 InstallAppsWithUnlimtedStorage); |
| 850 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 793 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
| 851 InstallAppsAndCheckStorageProtection); | 794 InstallAppsAndCheckStorageProtection); |
| 852 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 795 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
| 853 }; | 796 }; |
| 854 | 797 |
| 855 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 798 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
| OLD | NEW |