OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
11 #include <set> | 11 #include <set> |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
16 #include "base/compiler_specific.h" | 16 #include "base/compiler_specific.h" |
17 #include "base/file_path.h" | 17 #include "base/file_path.h" |
18 #include "base/gtest_prod_util.h" | 18 #include "base/gtest_prod_util.h" |
19 #include "base/memory/linked_ptr.h" | 19 #include "base/memory/linked_ptr.h" |
20 #include "base/memory/ref_counted.h" | 20 #include "base/memory/ref_counted.h" |
21 #include "base/memory/weak_ptr.h" | 21 #include "base/memory/weak_ptr.h" |
22 #include "base/property_bag.h" | 22 #include "base/property_bag.h" |
23 #include "base/string16.h" | 23 #include "base/string16.h" |
24 #include "base/time.h" | 24 #include "base/time.h" |
25 #include "base/tuple.h" | 25 #include "base/tuple.h" |
26 #include "chrome/browser/extensions/api/api_resource_controller.h" | 26 #include "chrome/browser/extensions/api/api_resource_controller.h" |
27 #include "chrome/browser/extensions/app_shortcut_manager.h" | 27 #include "chrome/browser/extensions/app_shortcut_manager.h" |
28 #include "chrome/browser/extensions/app_sync_bundle.h" | 28 #include "chrome/browser/extensions/app_sync_bundle.h" |
29 #include "chrome/browser/extensions/apps_promo.h" | |
30 #include "chrome/browser/extensions/extension_icon_manager.h" | 29 #include "chrome/browser/extensions/extension_icon_manager.h" |
31 #include "chrome/browser/extensions/extension_menu_manager.h" | 30 #include "chrome/browser/extensions/extension_menu_manager.h" |
32 #include "chrome/browser/extensions/extension_prefs.h" | 31 #include "chrome/browser/extensions/extension_prefs.h" |
33 #include "chrome/browser/extensions/extension_process_manager.h" | 32 #include "chrome/browser/extensions/extension_process_manager.h" |
34 #include "chrome/browser/extensions/extension_sync_bundle.h" | 33 #include "chrome/browser/extensions/extension_sync_bundle.h" |
35 #include "chrome/browser/extensions/extension_toolbar_model.h" | 34 #include "chrome/browser/extensions/extension_toolbar_model.h" |
36 #include "chrome/browser/extensions/extension_warning_set.h" | 35 #include "chrome/browser/extensions/extension_warning_set.h" |
37 #include "chrome/browser/extensions/extensions_quota_service.h" | 36 #include "chrome/browser/extensions/extensions_quota_service.h" |
38 #include "chrome/browser/extensions/external_extension_provider_interface.h" | 37 #include "chrome/browser/extensions/external_extension_provider_interface.h" |
39 #include "chrome/browser/extensions/pending_extension_manager.h" | 38 #include "chrome/browser/extensions/pending_extension_manager.h" |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 | 208 |
210 // Retuns a set of all installed, disabled, and terminated extensions and | 209 // Retuns a set of all installed, disabled, and terminated extensions and |
211 // transfers ownership to caller. | 210 // transfers ownership to caller. |
212 const ExtensionSet* GenerateInstalledExtensionsSet() const; | 211 const ExtensionSet* GenerateInstalledExtensionsSet() const; |
213 | 212 |
214 // Gets the object managing the set of pending extensions. | 213 // Gets the object managing the set of pending extensions. |
215 virtual PendingExtensionManager* pending_extension_manager() OVERRIDE; | 214 virtual PendingExtensionManager* pending_extension_manager() OVERRIDE; |
216 | 215 |
217 const FilePath& install_directory() const { return install_directory_; } | 216 const FilePath& install_directory() const { return install_directory_; } |
218 | 217 |
219 AppsPromo* apps_promo() { return &apps_promo_; } | |
220 | |
221 extensions::ProcessMap* process_map() { return &process_map_; } | 218 extensions::ProcessMap* process_map() { return &process_map_; } |
222 | 219 |
223 // Whether this extension can run in an incognito window. | 220 // Whether this extension can run in an incognito window. |
224 virtual bool IsIncognitoEnabled(const std::string& extension_id) const; | 221 virtual bool IsIncognitoEnabled(const std::string& extension_id) const; |
225 virtual void SetIsIncognitoEnabled(const std::string& extension_id, | 222 virtual void SetIsIncognitoEnabled(const std::string& extension_id, |
226 bool enabled); | 223 bool enabled); |
227 | 224 |
228 // When app notification setup is done, we call this to save the developer's | 225 // When app notification setup is done, we call this to save the developer's |
229 // oauth client id which we'll need at uninstall time to revoke the oauth | 226 // oauth client id which we'll need at uninstall time to revoke the oauth |
230 // permission grant for sending notifications. | 227 // permission grant for sending notifications. |
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
782 // Keeps track of menu items added by extensions. | 779 // Keeps track of menu items added by extensions. |
783 ExtensionMenuManager menu_manager_; | 780 ExtensionMenuManager menu_manager_; |
784 | 781 |
785 // Keeps track of app notifications. | 782 // Keeps track of app notifications. |
786 scoped_refptr<AppNotificationManager> app_notification_manager_; | 783 scoped_refptr<AppNotificationManager> app_notification_manager_; |
787 | 784 |
788 // Keeps track of favicon-sized omnibox icons for extensions. | 785 // Keeps track of favicon-sized omnibox icons for extensions. |
789 ExtensionIconManager omnibox_icon_manager_; | 786 ExtensionIconManager omnibox_icon_manager_; |
790 ExtensionIconManager omnibox_popup_icon_manager_; | 787 ExtensionIconManager omnibox_popup_icon_manager_; |
791 | 788 |
792 // Manages the promotion of the web store. | |
793 AppsPromo apps_promo_; | |
794 | |
795 // Flag to make sure event routers are only initialized once. | 789 // Flag to make sure event routers are only initialized once. |
796 bool event_routers_initialized_; | 790 bool event_routers_initialized_; |
797 | 791 |
798 scoped_ptr<HistoryExtensionEventRouter> history_event_router_; | 792 scoped_ptr<HistoryExtensionEventRouter> history_event_router_; |
799 | 793 |
800 scoped_ptr<ExtensionBrowserEventRouter> browser_event_router_; | 794 scoped_ptr<ExtensionBrowserEventRouter> browser_event_router_; |
801 | 795 |
802 scoped_ptr<ExtensionPreferenceEventRouter> preference_event_router_; | 796 scoped_ptr<ExtensionPreferenceEventRouter> preference_event_router_; |
803 | 797 |
804 scoped_ptr<BookmarkExtensionEventRouter> bookmark_event_router_; | 798 scoped_ptr<BookmarkExtensionEventRouter> bookmark_event_router_; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 scoped_ptr<ExtensionGlobalError> extension_global_error_; | 842 scoped_ptr<ExtensionGlobalError> extension_global_error_; |
849 | 843 |
850 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 844 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
851 InstallAppsWithUnlimtedStorage); | 845 InstallAppsWithUnlimtedStorage); |
852 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 846 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
853 InstallAppsAndCheckStorageProtection); | 847 InstallAppsAndCheckStorageProtection); |
854 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 848 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
855 }; | 849 }; |
856 | 850 |
857 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 851 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
OLD | NEW |