| 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 26 matching lines...) Expand all Loading... |
| 37 #include "content/common/notification_observer.h" | 37 #include "content/common/notification_observer.h" |
| 38 #include "content/common/notification_registrar.h" | 38 #include "content/common/notification_registrar.h" |
| 39 #include "content/common/property_bag.h" | 39 #include "content/common/property_bag.h" |
| 40 | 40 |
| 41 class CrxInstaller; | 41 class CrxInstaller; |
| 42 class ExtensionBrowserEventRouter; | 42 class ExtensionBrowserEventRouter; |
| 43 class ExtensionContentSettingsStore; | 43 class ExtensionContentSettingsStore; |
| 44 class ExtensionInstallUI; | 44 class ExtensionInstallUI; |
| 45 class ExtensionPreferenceEventRouter; | 45 class ExtensionPreferenceEventRouter; |
| 46 class ExtensionServiceBackend; | 46 class ExtensionServiceBackend; |
| 47 class ExtensionSettings; |
| 47 struct ExtensionSyncData; | 48 struct ExtensionSyncData; |
| 48 class ExtensionToolbarModel; | 49 class ExtensionToolbarModel; |
| 49 class ExtensionUpdater; | 50 class ExtensionUpdater; |
| 50 class GURL; | 51 class GURL; |
| 51 class PendingExtensionManager; | 52 class PendingExtensionManager; |
| 52 class Profile; | 53 class Profile; |
| 53 class Version; | 54 class Version; |
| 54 | 55 |
| 55 // This is an interface class to encapsulate the dependencies that | 56 // This is an interface class to encapsulate the dependencies that |
| 56 // various classes have on ExtensionService. This allows easy mocking. | 57 // various classes have on ExtensionService. This allows easy mocking. |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 // true iff the target extension exists. | 180 // true iff the target extension exists. |
| 180 static bool UninstallExtensionHelper(ExtensionService* extensions_service, | 181 static bool UninstallExtensionHelper(ExtensionService* extensions_service, |
| 181 const std::string& extension_id); | 182 const std::string& extension_id); |
| 182 | 183 |
| 183 // Constructor stores pointers to |profile| and |extension_prefs| but | 184 // Constructor stores pointers to |profile| and |extension_prefs| but |
| 184 // ownership remains at caller. | 185 // ownership remains at caller. |
| 185 ExtensionService(Profile* profile, | 186 ExtensionService(Profile* profile, |
| 186 const CommandLine* command_line, | 187 const CommandLine* command_line, |
| 187 const FilePath& install_directory, | 188 const FilePath& install_directory, |
| 188 ExtensionPrefs* extension_prefs, | 189 ExtensionPrefs* extension_prefs, |
| 190 ExtensionSettings* extension_settings, |
| 189 bool autoupdate_enabled, | 191 bool autoupdate_enabled, |
| 190 bool extensions_enabled); | 192 bool extensions_enabled); |
| 191 | 193 |
| 192 virtual ~ExtensionService(); | 194 virtual ~ExtensionService(); |
| 193 | 195 |
| 194 // Gets the list of currently installed extensions. | 196 // Gets the list of currently installed extensions. |
| 195 virtual const ExtensionList* extensions() const OVERRIDE; | 197 virtual const ExtensionList* extensions() const OVERRIDE; |
| 196 const ExtensionList* disabled_extensions() const; | 198 const ExtensionList* disabled_extensions() const; |
| 197 const ExtensionList* terminated_extensions() const; | 199 const ExtensionList* terminated_extensions() const; |
| 198 | 200 |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 bool show_extensions_prompts() { | 424 bool show_extensions_prompts() { |
| 423 return show_extensions_prompts_; | 425 return show_extensions_prompts_; |
| 424 } | 426 } |
| 425 | 427 |
| 426 Profile* profile(); | 428 Profile* profile(); |
| 427 | 429 |
| 428 // TODO(skerner): Change to const ExtensionPrefs& extension_prefs() const, | 430 // TODO(skerner): Change to const ExtensionPrefs& extension_prefs() const, |
| 429 // ExtensionPrefs* mutable_extension_prefs(). | 431 // ExtensionPrefs* mutable_extension_prefs(). |
| 430 ExtensionPrefs* extension_prefs(); | 432 ExtensionPrefs* extension_prefs(); |
| 431 | 433 |
| 434 ExtensionSettings* extension_settings(); |
| 435 |
| 432 ExtensionContentSettingsStore* GetExtensionContentSettingsStore(); | 436 ExtensionContentSettingsStore* GetExtensionContentSettingsStore(); |
| 433 | 437 |
| 434 // Whether the extension service is ready. | 438 // Whether the extension service is ready. |
| 435 // TODO(skerner): Get rid of this method. crbug.com/63756 | 439 // TODO(skerner): Get rid of this method. crbug.com/63756 |
| 436 bool is_ready() { return ready_; } | 440 bool is_ready() { return ready_; } |
| 437 | 441 |
| 438 // Note that this may return NULL if autoupdate is not turned on. | 442 // Note that this may return NULL if autoupdate is not turned on. |
| 439 ExtensionUpdater* updater(); | 443 ExtensionUpdater* updater(); |
| 440 | 444 |
| 441 ExtensionToolbarModel* toolbar_model() { return &toolbar_model_; } | 445 ExtensionToolbarModel* toolbar_model() { return &toolbar_model_; } |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 base::WeakPtrFactory<ExtensionService> weak_ptr_factory_; | 600 base::WeakPtrFactory<ExtensionService> weak_ptr_factory_; |
| 597 | 601 |
| 598 ScopedRunnableMethodFactory<ExtensionService> method_factory_; | 602 ScopedRunnableMethodFactory<ExtensionService> method_factory_; |
| 599 | 603 |
| 600 // The profile this ExtensionService is part of. | 604 // The profile this ExtensionService is part of. |
| 601 Profile* profile_; | 605 Profile* profile_; |
| 602 | 606 |
| 603 // Preferences for the owning profile (weak reference). | 607 // Preferences for the owning profile (weak reference). |
| 604 ExtensionPrefs* extension_prefs_; | 608 ExtensionPrefs* extension_prefs_; |
| 605 | 609 |
| 610 // Settings for the owning profile (weak reference). |
| 611 ExtensionSettings* extension_settings_; |
| 612 |
| 606 // The current list of installed extensions. | 613 // The current list of installed extensions. |
| 607 // TODO(aa): This should use chrome/common/extensions/extension_set.h. | 614 // TODO(aa): This should use chrome/common/extensions/extension_set.h. |
| 608 ExtensionList extensions_; | 615 ExtensionList extensions_; |
| 609 | 616 |
| 610 // The list of installed extensions that have been disabled. | 617 // The list of installed extensions that have been disabled. |
| 611 ExtensionList disabled_extensions_; | 618 ExtensionList disabled_extensions_; |
| 612 | 619 |
| 613 // The list of installed extensions that have been terminated. | 620 // The list of installed extensions that have been terminated. |
| 614 ExtensionList terminated_extensions_; | 621 ExtensionList terminated_extensions_; |
| 615 | 622 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 706 NaClModuleInfoList nacl_module_list_; | 713 NaClModuleInfoList nacl_module_list_; |
| 707 | 714 |
| 708 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 715 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
| 709 InstallAppsWithUnlimtedStorage); | 716 InstallAppsWithUnlimtedStorage); |
| 710 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 717 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
| 711 InstallAppsAndCheckStorageProtection); | 718 InstallAppsAndCheckStorageProtection); |
| 712 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 719 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
| 713 }; | 720 }; |
| 714 | 721 |
| 715 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 722 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
| OLD | NEW |