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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 class ExtensionBookmarkEventRouter; | 44 class ExtensionBookmarkEventRouter; |
45 class ExtensionBrowserEventRouter; | 45 class ExtensionBrowserEventRouter; |
46 class ExtensionContentSettingsStore; | 46 class ExtensionContentSettingsStore; |
47 class ExtensionCookiesEventRouter; | 47 class ExtensionCookiesEventRouter; |
48 class ExtensionFileBrowserEventRouter; | 48 class ExtensionFileBrowserEventRouter; |
49 class ExtensionHistoryEventRouter; | 49 class ExtensionHistoryEventRouter; |
50 class ExtensionInstallUI; | 50 class ExtensionInstallUI; |
51 class ExtensionManagementEventRouter; | 51 class ExtensionManagementEventRouter; |
52 class ExtensionPreferenceEventRouter; | 52 class ExtensionPreferenceEventRouter; |
53 class ExtensionServiceBackend; | 53 class ExtensionServiceBackend; |
| 54 class ExtensionSettings; |
54 struct ExtensionSyncData; | 55 struct ExtensionSyncData; |
55 class ExtensionToolbarModel; | 56 class ExtensionToolbarModel; |
56 class ExtensionUpdater; | 57 class ExtensionUpdater; |
57 class ExtensionWebNavigationEventRouter; | 58 class ExtensionWebNavigationEventRouter; |
58 class GURL; | 59 class GURL; |
59 class PendingExtensionManager; | 60 class PendingExtensionManager; |
60 class Profile; | 61 class Profile; |
61 class Version; | 62 class Version; |
62 | 63 |
63 // This is an interface class to encapsulate the dependencies that | 64 // This is an interface class to encapsulate the dependencies that |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 // The name of the directory inside the profile where extensions are | 156 // The name of the directory inside the profile where extensions are |
156 // installed to. | 157 // installed to. |
157 static const char* kInstallDirectoryName; | 158 static const char* kInstallDirectoryName; |
158 | 159 |
159 // If auto-updates are turned on, default to running every 5 hours. | 160 // If auto-updates are turned on, default to running every 5 hours. |
160 static const int kDefaultUpdateFrequencySeconds = 60 * 60 * 5; | 161 static const int kDefaultUpdateFrequencySeconds = 60 * 60 * 5; |
161 | 162 |
162 // The name of the file that the current active version number is stored in. | 163 // The name of the file that the current active version number is stored in. |
163 static const char* kCurrentVersionFileName; | 164 static const char* kCurrentVersionFileName; |
164 | 165 |
| 166 // The name of the directory inside the profile where per-extension settings |
| 167 // are stored. |
| 168 static const char* kSettingsDirectoryName; |
| 169 |
165 // Determine if a given extension download should be treated as if it came | 170 // Determine if a given extension download should be treated as if it came |
166 // from the gallery. Note that this is requires *both* that the download_url | 171 // from the gallery. Note that this is requires *both* that the download_url |
167 // match and that the download was referred from a gallery page. | 172 // match and that the download was referred from a gallery page. |
168 bool IsDownloadFromGallery(const GURL& download_url, | 173 bool IsDownloadFromGallery(const GURL& download_url, |
169 const GURL& referrer_url); | 174 const GURL& referrer_url); |
170 | 175 |
171 // Determine if the downloaded extension came from the theme mini-gallery, | 176 // Determine if the downloaded extension came from the theme mini-gallery, |
172 // Used to test if we need to show the "Loading" dialog for themes. | 177 // Used to test if we need to show the "Loading" dialog for themes. |
173 static bool IsDownloadFromMiniGallery(const GURL& download_url); | 178 static bool IsDownloadFromMiniGallery(const GURL& download_url); |
174 | 179 |
(...skipping 14 matching lines...) Expand all Loading... |
189 // true iff the target extension exists. | 194 // true iff the target extension exists. |
190 static bool UninstallExtensionHelper(ExtensionService* extensions_service, | 195 static bool UninstallExtensionHelper(ExtensionService* extensions_service, |
191 const std::string& extension_id); | 196 const std::string& extension_id); |
192 | 197 |
193 // Constructor stores pointers to |profile| and |extension_prefs| but | 198 // Constructor stores pointers to |profile| and |extension_prefs| but |
194 // ownership remains at caller. | 199 // ownership remains at caller. |
195 ExtensionService(Profile* profile, | 200 ExtensionService(Profile* profile, |
196 const CommandLine* command_line, | 201 const CommandLine* command_line, |
197 const FilePath& install_directory, | 202 const FilePath& install_directory, |
198 ExtensionPrefs* extension_prefs, | 203 ExtensionPrefs* extension_prefs, |
| 204 ExtensionSettings* extension_settings, |
199 bool autoupdate_enabled, | 205 bool autoupdate_enabled, |
200 bool extensions_enabled); | 206 bool extensions_enabled); |
201 | 207 |
202 virtual ~ExtensionService(); | 208 virtual ~ExtensionService(); |
203 | 209 |
204 // Gets the list of currently installed extensions. | 210 // Gets the list of currently installed extensions. |
205 virtual const ExtensionList* extensions() const OVERRIDE; | 211 virtual const ExtensionList* extensions() const OVERRIDE; |
206 const ExtensionList* disabled_extensions() const; | 212 const ExtensionList* disabled_extensions() const; |
207 const ExtensionList* terminated_extensions() const; | 213 const ExtensionList* terminated_extensions() const; |
208 | 214 |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 bool show_extensions_prompts() { | 457 bool show_extensions_prompts() { |
452 return show_extensions_prompts_; | 458 return show_extensions_prompts_; |
453 } | 459 } |
454 | 460 |
455 Profile* profile(); | 461 Profile* profile(); |
456 | 462 |
457 // TODO(skerner): Change to const ExtensionPrefs& extension_prefs() const, | 463 // TODO(skerner): Change to const ExtensionPrefs& extension_prefs() const, |
458 // ExtensionPrefs* mutable_extension_prefs(). | 464 // ExtensionPrefs* mutable_extension_prefs(). |
459 ExtensionPrefs* extension_prefs(); | 465 ExtensionPrefs* extension_prefs(); |
460 | 466 |
| 467 ExtensionSettings* extension_settings(); |
| 468 |
461 ExtensionContentSettingsStore* GetExtensionContentSettingsStore(); | 469 ExtensionContentSettingsStore* GetExtensionContentSettingsStore(); |
462 | 470 |
463 // Whether the extension service is ready. | 471 // Whether the extension service is ready. |
464 // TODO(skerner): Get rid of this method. crbug.com/63756 | 472 // TODO(skerner): Get rid of this method. crbug.com/63756 |
465 bool is_ready() { return ready_; } | 473 bool is_ready() { return ready_; } |
466 | 474 |
467 // Note that this may return NULL if autoupdate is not turned on. | 475 // Note that this may return NULL if autoupdate is not turned on. |
468 ExtensionUpdater* updater(); | 476 ExtensionUpdater* updater(); |
469 | 477 |
470 ExtensionToolbarModel* toolbar_model() { return &toolbar_model_; } | 478 ExtensionToolbarModel* toolbar_model() { return &toolbar_model_; } |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
638 base::WeakPtrFactory<ExtensionService> weak_ptr_factory_; | 646 base::WeakPtrFactory<ExtensionService> weak_ptr_factory_; |
639 | 647 |
640 ScopedRunnableMethodFactory<ExtensionService> method_factory_; | 648 ScopedRunnableMethodFactory<ExtensionService> method_factory_; |
641 | 649 |
642 // The profile this ExtensionService is part of. | 650 // The profile this ExtensionService is part of. |
643 Profile* profile_; | 651 Profile* profile_; |
644 | 652 |
645 // Preferences for the owning profile (weak reference). | 653 // Preferences for the owning profile (weak reference). |
646 ExtensionPrefs* extension_prefs_; | 654 ExtensionPrefs* extension_prefs_; |
647 | 655 |
| 656 // Settings for the owning profile (weak reference). |
| 657 ExtensionSettings* extension_settings_; |
| 658 |
648 // The current list of installed extensions. | 659 // The current list of installed extensions. |
649 // TODO(aa): This should use chrome/common/extensions/extension_set.h. | 660 // TODO(aa): This should use chrome/common/extensions/extension_set.h. |
650 ExtensionList extensions_; | 661 ExtensionList extensions_; |
651 | 662 |
652 // The list of installed extensions that have been disabled. | 663 // The list of installed extensions that have been disabled. |
653 ExtensionList disabled_extensions_; | 664 ExtensionList disabled_extensions_; |
654 | 665 |
655 // The list of installed extensions that have been terminated. | 666 // The list of installed extensions that have been terminated. |
656 ExtensionList terminated_extensions_; | 667 ExtensionList terminated_extensions_; |
657 | 668 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
768 NaClModuleInfoList nacl_module_list_; | 779 NaClModuleInfoList nacl_module_list_; |
769 | 780 |
770 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 781 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
771 InstallAppsWithUnlimtedStorage); | 782 InstallAppsWithUnlimtedStorage); |
772 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 783 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
773 InstallAppsAndCheckStorageProtection); | 784 InstallAppsAndCheckStorageProtection); |
774 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 785 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
775 }; | 786 }; |
776 | 787 |
777 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 788 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
OLD | NEW |