Chromium Code Reviews| 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 10 matching lines...) Expand all Loading... | |
| 21 #include "base/task.h" | 21 #include "base/task.h" |
| 22 #include "base/time.h" | 22 #include "base/time.h" |
| 23 #include "base/tuple.h" | 23 #include "base/tuple.h" |
| 24 #include "chrome/browser/extensions/apps_promo.h" | 24 #include "chrome/browser/extensions/apps_promo.h" |
| 25 #include "chrome/browser/extensions/extension_app_api.h" | 25 #include "chrome/browser/extensions/extension_app_api.h" |
| 26 #include "chrome/browser/extensions/extension_icon_manager.h" | 26 #include "chrome/browser/extensions/extension_icon_manager.h" |
| 27 #include "chrome/browser/extensions/extension_menu_manager.h" | 27 #include "chrome/browser/extensions/extension_menu_manager.h" |
| 28 #include "chrome/browser/extensions/extension_prefs.h" | 28 #include "chrome/browser/extensions/extension_prefs.h" |
| 29 #include "chrome/browser/extensions/extension_permissions_api.h" | 29 #include "chrome/browser/extensions/extension_permissions_api.h" |
| 30 #include "chrome/browser/extensions/extension_process_manager.h" | 30 #include "chrome/browser/extensions/extension_process_manager.h" |
| 31 #include "chrome/browser/extensions/extension_settings_ui_wrapper.h" | |
| 31 #include "chrome/browser/extensions/extension_sync_data.h" | 32 #include "chrome/browser/extensions/extension_sync_data.h" |
| 32 #include "chrome/browser/extensions/extension_toolbar_model.h" | 33 #include "chrome/browser/extensions/extension_toolbar_model.h" |
| 33 #include "chrome/browser/extensions/extensions_quota_service.h" | 34 #include "chrome/browser/extensions/extensions_quota_service.h" |
| 34 #include "chrome/browser/extensions/external_extension_provider_interface.h" | 35 #include "chrome/browser/extensions/external_extension_provider_interface.h" |
| 35 #include "chrome/browser/extensions/pending_extension_manager.h" | 36 #include "chrome/browser/extensions/pending_extension_manager.h" |
| 36 #include "chrome/browser/extensions/sandboxed_extension_unpacker.h" | 37 #include "chrome/browser/extensions/sandboxed_extension_unpacker.h" |
| 37 #include "chrome/browser/prefs/pref_change_registrar.h" | 38 #include "chrome/browser/prefs/pref_change_registrar.h" |
| 38 #include "chrome/browser/sync/api/sync_change.h" | 39 #include "chrome/browser/sync/api/sync_change.h" |
| 39 #include "chrome/browser/sync/api/syncable_service.h" | 40 #include "chrome/browser/sync/api/syncable_service.h" |
| 40 #include "chrome/common/extensions/extension.h" | 41 #include "chrome/common/extensions/extension.h" |
| 41 #include "chrome/common/extensions/extension_constants.h" | 42 #include "chrome/common/extensions/extension_constants.h" |
| 42 #include "content/browser/browser_thread.h" | 43 #include "content/browser/browser_thread.h" |
| 43 #include "content/common/notification_observer.h" | 44 #include "content/common/notification_observer.h" |
| 44 #include "content/common/notification_registrar.h" | 45 #include "content/common/notification_registrar.h" |
| 45 #include "content/common/property_bag.h" | 46 #include "content/common/property_bag.h" |
| 46 | 47 |
| 47 class CrxInstaller; | 48 class CrxInstaller; |
| 48 class ExtensionBookmarkEventRouter; | 49 class ExtensionBookmarkEventRouter; |
| 49 class ExtensionBrowserEventRouter; | 50 class ExtensionBrowserEventRouter; |
| 50 class ExtensionContentSettingsStore; | 51 class ExtensionContentSettingsStore; |
| 51 class ExtensionCookiesEventRouter; | 52 class ExtensionCookiesEventRouter; |
| 52 class ExtensionFileBrowserEventRouter; | 53 class ExtensionFileBrowserEventRouter; |
| 53 class ExtensionHistoryEventRouter; | 54 class ExtensionHistoryEventRouter; |
| 54 class ExtensionInstallUI; | 55 class ExtensionInstallUI; |
| 55 class ExtensionManagementEventRouter; | 56 class ExtensionManagementEventRouter; |
| 56 class ExtensionPreferenceEventRouter; | 57 class ExtensionPreferenceEventRouter; |
| 57 class ExtensionServiceBackend; | 58 class ExtensionServiceBackend; |
| 58 class ExtensionSettings; | |
| 59 class ExtensionSyncData; | 59 class ExtensionSyncData; |
| 60 class ExtensionToolbarModel; | 60 class ExtensionToolbarModel; |
| 61 class ExtensionUpdater; | 61 class ExtensionUpdater; |
| 62 class ExtensionWebNavigationEventRouter; | 62 class ExtensionWebNavigationEventRouter; |
| 63 class GURL; | 63 class GURL; |
| 64 class PendingExtensionManager; | 64 class PendingExtensionManager; |
| 65 class Profile; | 65 class Profile; |
| 66 class SyncData; | 66 class SyncData; |
| 67 class Version; | 67 class Version; |
| 68 | 68 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 171 // true iff the target extension exists. | 171 // true iff the target extension exists. |
| 172 static bool UninstallExtensionHelper(ExtensionService* extensions_service, | 172 static bool UninstallExtensionHelper(ExtensionService* extensions_service, |
| 173 const std::string& extension_id); | 173 const std::string& extension_id); |
| 174 | 174 |
| 175 // Constructor stores pointers to |profile| and |extension_prefs| but | 175 // Constructor stores pointers to |profile| and |extension_prefs| but |
| 176 // ownership remains at caller. | 176 // ownership remains at caller. |
| 177 ExtensionService(Profile* profile, | 177 ExtensionService(Profile* profile, |
| 178 const CommandLine* command_line, | 178 const CommandLine* command_line, |
| 179 const FilePath& install_directory, | 179 const FilePath& install_directory, |
| 180 ExtensionPrefs* extension_prefs, | 180 ExtensionPrefs* extension_prefs, |
| 181 ExtensionSettings* extension_settings, | |
| 182 bool autoupdate_enabled, | 181 bool autoupdate_enabled, |
| 183 bool extensions_enabled); | 182 bool extensions_enabled); |
| 184 | 183 |
| 185 virtual ~ExtensionService(); | 184 virtual ~ExtensionService(); |
| 186 | 185 |
| 187 // Gets the list of currently installed extensions. | 186 // Gets the list of currently installed extensions. |
| 188 virtual const ExtensionList* extensions() const OVERRIDE; | 187 virtual const ExtensionList* extensions() const OVERRIDE; |
| 189 const ExtensionList* disabled_extensions() const; | 188 const ExtensionList* disabled_extensions() const; |
| 190 const ExtensionList* terminated_extensions() const; | 189 const ExtensionList* terminated_extensions() const; |
| 191 | 190 |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 430 bool show_extensions_prompts() { | 429 bool show_extensions_prompts() { |
| 431 return show_extensions_prompts_; | 430 return show_extensions_prompts_; |
| 432 } | 431 } |
| 433 | 432 |
| 434 Profile* profile(); | 433 Profile* profile(); |
| 435 | 434 |
| 436 // TODO(skerner): Change to const ExtensionPrefs& extension_prefs() const, | 435 // TODO(skerner): Change to const ExtensionPrefs& extension_prefs() const, |
| 437 // ExtensionPrefs* mutable_extension_prefs(). | 436 // ExtensionPrefs* mutable_extension_prefs(). |
| 438 ExtensionPrefs* extension_prefs(); | 437 ExtensionPrefs* extension_prefs(); |
| 439 | 438 |
| 440 ExtensionSettings* extension_settings(); | 439 ExtensionSettingsUIWrapper* extension_settings(); |
| 441 | 440 |
| 442 ExtensionContentSettingsStore* GetExtensionContentSettingsStore(); | 441 ExtensionContentSettingsStore* GetExtensionContentSettingsStore(); |
| 443 | 442 |
| 444 // Whether the extension service is ready. | 443 // Whether the extension service is ready. |
| 445 // TODO(skerner): Get rid of this method. crbug.com/63756 | 444 // TODO(skerner): Get rid of this method. crbug.com/63756 |
| 446 bool is_ready() { return ready_; } | 445 bool is_ready() { return ready_; } |
| 447 | 446 |
| 448 // Note that this may return NULL if autoupdate is not turned on. | 447 // Note that this may return NULL if autoupdate is not turned on. |
| 449 ExtensionUpdater* updater(); | 448 ExtensionUpdater* updater(); |
| 450 | 449 |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 659 base::WeakPtrFactory<ExtensionService> weak_ptr_factory_; | 658 base::WeakPtrFactory<ExtensionService> weak_ptr_factory_; |
| 660 | 659 |
| 661 ScopedRunnableMethodFactory<ExtensionService> method_factory_; | 660 ScopedRunnableMethodFactory<ExtensionService> method_factory_; |
| 662 | 661 |
| 663 // The profile this ExtensionService is part of. | 662 // The profile this ExtensionService is part of. |
| 664 Profile* profile_; | 663 Profile* profile_; |
| 665 | 664 |
| 666 // Preferences for the owning profile (weak reference). | 665 // Preferences for the owning profile (weak reference). |
| 667 ExtensionPrefs* extension_prefs_; | 666 ExtensionPrefs* extension_prefs_; |
| 668 | 667 |
| 669 // Settings for the owning profile (weak reference). | 668 // Settings for the owning profile. |
| 670 ExtensionSettings* extension_settings_; | 669 scoped_ptr<ExtensionSettingsUIWrapper> extension_settings_; |
|
akalin
2011/09/20 14:53:11
no need to make this a scoped_ptr; just have 'Exte
not at google - send to devlin
2011/09/21 00:20:14
Done.
| |
| 671 | 670 |
| 672 // The current list of installed extensions. | 671 // The current list of installed extensions. |
| 673 // TODO(aa): This should use chrome/common/extensions/extension_set.h. | 672 // TODO(aa): This should use chrome/common/extensions/extension_set.h. |
| 674 ExtensionList extensions_; | 673 ExtensionList extensions_; |
| 675 | 674 |
| 676 // The list of installed extensions that have been disabled. | 675 // The list of installed extensions that have been disabled. |
| 677 ExtensionList disabled_extensions_; | 676 ExtensionList disabled_extensions_; |
| 678 | 677 |
| 679 // The list of installed extensions that have been terminated. | 678 // The list of installed extensions that have been terminated. |
| 680 ExtensionList terminated_extensions_; | 679 ExtensionList terminated_extensions_; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 795 SyncBundle extension_sync_bundle_; | 794 SyncBundle extension_sync_bundle_; |
| 796 | 795 |
| 797 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 796 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
| 798 InstallAppsWithUnlimtedStorage); | 797 InstallAppsWithUnlimtedStorage); |
| 799 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 798 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
| 800 InstallAppsAndCheckStorageProtection); | 799 InstallAppsAndCheckStorageProtection); |
| 801 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 800 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
| 802 }; | 801 }; |
| 803 | 802 |
| 804 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 803 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
| OLD | NEW |