OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_EXTENSIONS_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSIONS_SERVICE_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSIONS_SERVICE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSIONS_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/tuple.h" | 21 #include "base/tuple.h" |
22 #include "chrome/browser/chrome_thread.h" | 22 #include "chrome/browser/chrome_thread.h" |
23 #include "chrome/browser/extensions/extension_icon_manager.h" | 23 #include "chrome/browser/extensions/extension_icon_manager.h" |
24 #include "chrome/browser/extensions/extension_menu_manager.h" | 24 #include "chrome/browser/extensions/extension_menu_manager.h" |
25 #include "chrome/browser/extensions/extension_prefs.h" | 25 #include "chrome/browser/extensions/extension_prefs.h" |
26 #include "chrome/browser/extensions/extension_process_manager.h" | 26 #include "chrome/browser/extensions/extension_process_manager.h" |
27 #include "chrome/browser/extensions/extension_toolbar_model.h" | 27 #include "chrome/browser/extensions/extension_toolbar_model.h" |
28 #include "chrome/browser/extensions/extensions_quota_service.h" | 28 #include "chrome/browser/extensions/extensions_quota_service.h" |
29 #include "chrome/browser/extensions/external_extension_provider.h" | 29 #include "chrome/browser/extensions/external_extension_provider.h" |
30 #include "chrome/browser/extensions/sandboxed_extension_unpacker.h" | 30 #include "chrome/browser/extensions/sandboxed_extension_unpacker.h" |
| 31 #include "chrome/browser/prefs/pref_change_registrar.h" |
31 #include "chrome/common/notification_observer.h" | 32 #include "chrome/common/notification_observer.h" |
32 #include "chrome/common/notification_registrar.h" | 33 #include "chrome/common/notification_registrar.h" |
33 #include "chrome/common/extensions/extension.h" | 34 #include "chrome/common/extensions/extension.h" |
34 | 35 |
35 class ExtensionsServiceBackend; | 36 class ExtensionsServiceBackend; |
36 class ExtensionToolbarModel; | 37 class ExtensionToolbarModel; |
37 class ExtensionUpdater; | 38 class ExtensionUpdater; |
38 class GURL; | 39 class GURL; |
39 class PrefService; | 40 class PrefService; |
40 class Profile; | 41 class Profile; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 // that the download was referred from a gallery page. | 134 // that the download was referred from a gallery page. |
134 static bool IsDownloadFromGallery(const GURL& download_url, | 135 static bool IsDownloadFromGallery(const GURL& download_url, |
135 const GURL& referrer_url); | 136 const GURL& referrer_url); |
136 | 137 |
137 // Determine if the downloaded extension came from the theme mini-gallery, | 138 // Determine if the downloaded extension came from the theme mini-gallery, |
138 // Used to test if we need to show the "Loading" dialog for themes. | 139 // Used to test if we need to show the "Loading" dialog for themes. |
139 static bool IsDownloadFromMiniGallery(const GURL& download_url); | 140 static bool IsDownloadFromMiniGallery(const GURL& download_url); |
140 | 141 |
141 ExtensionsService(Profile* profile, | 142 ExtensionsService(Profile* profile, |
142 const CommandLine* command_line, | 143 const CommandLine* command_line, |
143 PrefService* prefs, | |
144 const FilePath& install_directory, | 144 const FilePath& install_directory, |
145 bool autoupdate_enabled); | 145 bool autoupdate_enabled); |
146 | 146 |
147 // Gets the list of currently installed extensions. | 147 // Gets the list of currently installed extensions. |
148 virtual const ExtensionList* extensions() const { return &extensions_; } | 148 virtual const ExtensionList* extensions() const { return &extensions_; } |
149 virtual const ExtensionList* disabled_extensions() const { | 149 virtual const ExtensionList* disabled_extensions() const { |
150 return &disabled_extensions_; | 150 return &disabled_extensions_; |
151 } | 151 } |
152 | 152 |
153 // Gets the set of pending extensions. | 153 // Gets the set of pending extensions. |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 // it can be re-enabled upon a successful load. | 479 // it can be re-enabled upon a successful load. |
480 typedef std::map<std::string, FilePath> DisabledExtensionPathMap; | 480 typedef std::map<std::string, FilePath> DisabledExtensionPathMap; |
481 DisabledExtensionPathMap disabled_extension_paths_; | 481 DisabledExtensionPathMap disabled_extension_paths_; |
482 | 482 |
483 // Map of inspector cookies that are detached, waiting for an extension to be | 483 // Map of inspector cookies that are detached, waiting for an extension to be |
484 // reloaded. | 484 // reloaded. |
485 typedef std::map<std::string, int> OrphanedDevTools; | 485 typedef std::map<std::string, int> OrphanedDevTools; |
486 OrphanedDevTools orphaned_dev_tools_; | 486 OrphanedDevTools orphaned_dev_tools_; |
487 | 487 |
488 NotificationRegistrar registrar_; | 488 NotificationRegistrar registrar_; |
| 489 PrefChangeRegistrar pref_change_registrar_; |
489 | 490 |
490 // Keeps track of menu items added by extensions. | 491 // Keeps track of menu items added by extensions. |
491 ExtensionMenuManager menu_manager_; | 492 ExtensionMenuManager menu_manager_; |
492 | 493 |
493 // Keeps track of favicon-sized omnibox icons for extensions. | 494 // Keeps track of favicon-sized omnibox icons for extensions. |
494 ExtensionIconManager omnibox_icon_manager_; | 495 ExtensionIconManager omnibox_icon_manager_; |
495 ExtensionIconManager omnibox_popup_icon_manager_; | 496 ExtensionIconManager omnibox_popup_icon_manager_; |
496 | 497 |
497 // List of registered component extensions (see Extension::Location). | 498 // List of registered component extensions (see Extension::Location). |
498 typedef std::vector<ComponentExtensionInfo> RegisteredComponentExtensions; | 499 typedef std::vector<ComponentExtensionInfo> RegisteredComponentExtensions; |
(...skipping 14 matching lines...) Expand all Loading... |
513 FRIEND_TEST_ALL_PREFIXES(ExtensionsServiceTest, | 514 FRIEND_TEST_ALL_PREFIXES(ExtensionsServiceTest, |
514 UpdatePendingExtensionAlreadyInstalled); | 515 UpdatePendingExtensionAlreadyInstalled); |
515 FRIEND_TEST_ALL_PREFIXES(ExtensionsServiceTest, | 516 FRIEND_TEST_ALL_PREFIXES(ExtensionsServiceTest, |
516 InstallAppsWithUnlimtedStorage); | 517 InstallAppsWithUnlimtedStorage); |
517 FRIEND_TEST_ALL_PREFIXES(ExtensionsServiceTest, | 518 FRIEND_TEST_ALL_PREFIXES(ExtensionsServiceTest, |
518 InstallAppsAndCheckStorageProtection); | 519 InstallAppsAndCheckStorageProtection); |
519 DISALLOW_COPY_AND_ASSIGN(ExtensionsService); | 520 DISALLOW_COPY_AND_ASSIGN(ExtensionsService); |
520 }; | 521 }; |
521 | 522 |
522 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSIONS_SERVICE_H_ | 523 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSIONS_SERVICE_H_ |
OLD | NEW |