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 <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
68 class SyncData; | 68 class SyncData; |
69 class Version; | 69 class Version; |
70 | 70 |
71 namespace chromeos { | 71 namespace chromeos { |
72 class ExtensionInputMethodEventRouter; | 72 class ExtensionInputMethodEventRouter; |
73 } | 73 } |
74 | 74 |
75 namespace extensions { | 75 namespace extensions { |
76 class ComponentLoader; | 76 class ComponentLoader; |
77 class SettingsFrontend; | 77 class SettingsFrontend; |
78 class SocketController; | |
78 } | 79 } |
79 | 80 |
80 // This is an interface class to encapsulate the dependencies that | 81 // This is an interface class to encapsulate the dependencies that |
81 // various classes have on ExtensionService. This allows easy mocking. | 82 // various classes have on ExtensionService. This allows easy mocking. |
82 class ExtensionServiceInterface : public SyncableService { | 83 class ExtensionServiceInterface : public SyncableService { |
83 public: | 84 public: |
84 // A function that returns true if the given extension should be | 85 // A function that returns true if the given extension should be |
85 // included and false if it should be filtered out. Identical to | 86 // included and false if it should be filtered out. Identical to |
86 // PendingExtensionInfo::ShouldAllowInstallPredicate. | 87 // PendingExtensionInfo::ShouldAllowInstallPredicate. |
87 typedef bool (*ExtensionFilter)(const Extension&); | 88 typedef bool (*ExtensionFilter)(const Extension&); |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
562 #if defined(UNIT_TEST) | 563 #if defined(UNIT_TEST) |
563 void TrackTerminatedExtensionForTest(const Extension* extension) { | 564 void TrackTerminatedExtensionForTest(const Extension* extension) { |
564 TrackTerminatedExtension(extension); | 565 TrackTerminatedExtension(extension); |
565 } | 566 } |
566 #endif | 567 #endif |
567 | 568 |
568 ExtensionWarningSet* extension_warnings() { | 569 ExtensionWarningSet* extension_warnings() { |
569 return &extension_warnings_; | 570 return &extension_warnings_; |
570 } | 571 } |
571 | 572 |
573 extensions::SocketController* socket_controller() { | |
574 return socket_controller_; | |
575 } | |
576 | |
572 private: | 577 private: |
573 // Bundle of type (app or extension)-specific sync stuff. | 578 // Bundle of type (app or extension)-specific sync stuff. |
574 struct SyncBundle { | 579 struct SyncBundle { |
575 SyncBundle(); | 580 SyncBundle(); |
576 ~SyncBundle(); | 581 ~SyncBundle(); |
577 | 582 |
578 bool HasExtensionId(const std::string& id) const; | 583 bool HasExtensionId(const std::string& id) const; |
579 bool HasPendingExtensionId(const std::string& id) const; | 584 bool HasPendingExtensionId(const std::string& id) const; |
580 | 585 |
581 ExtensionFilter filter; | 586 ExtensionFilter filter; |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
678 // browser process. | 683 // browser process. |
679 void RegisterNaClModule(const GURL& url, const std::string& mime_type); | 684 void RegisterNaClModule(const GURL& url, const std::string& mime_type); |
680 void UnregisterNaClModule(const GURL& url); | 685 void UnregisterNaClModule(const GURL& url); |
681 | 686 |
682 // Call UpdatePluginListWithNaClModules() after registering or unregistering | 687 // Call UpdatePluginListWithNaClModules() after registering or unregistering |
683 // a NaCl module to see those changes reflected in the PluginList. | 688 // a NaCl module to see those changes reflected in the PluginList. |
684 void UpdatePluginListWithNaClModules(); | 689 void UpdatePluginListWithNaClModules(); |
685 | 690 |
686 NaClModuleInfoList::iterator FindNaClModule(const GURL& url); | 691 NaClModuleInfoList::iterator FindNaClModule(const GURL& url); |
687 | 692 |
693 static void DeleteSocketController( | |
694 extensions::SocketController* socket_controller); | |
695 | |
688 // The profile this ExtensionService is part of. | 696 // The profile this ExtensionService is part of. |
689 Profile* profile_; | 697 Profile* profile_; |
690 | 698 |
691 // Preferences for the owning profile (weak reference). | 699 // Preferences for the owning profile (weak reference). |
692 ExtensionPrefs* extension_prefs_; | 700 ExtensionPrefs* extension_prefs_; |
693 | 701 |
694 // Settings for the owning profile. | 702 // Settings for the owning profile. |
695 scoped_ptr<extensions::SettingsFrontend> settings_frontend_; | 703 scoped_ptr<extensions::SettingsFrontend> settings_frontend_; |
696 | 704 |
697 // The current list of installed extensions. | 705 // The current list of installed extensions. |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
812 bool external_extension_url_added_; | 820 bool external_extension_url_added_; |
813 | 821 |
814 NaClModuleInfoList nacl_module_list_; | 822 NaClModuleInfoList nacl_module_list_; |
815 | 823 |
816 SyncBundle app_sync_bundle_; | 824 SyncBundle app_sync_bundle_; |
817 SyncBundle extension_sync_bundle_; | 825 SyncBundle extension_sync_bundle_; |
818 | 826 |
819 // Contains an entry for each warning that shall be currently shown. | 827 // Contains an entry for each warning that shall be currently shown. |
820 ExtensionWarningSet extension_warnings_; | 828 ExtensionWarningSet extension_warnings_; |
821 | 829 |
830 extensions::SocketController* socket_controller_; | |
Aaron Boodman
2011/12/07 23:16:22
Add a comment explaining why this is a bare pointe
| |
831 | |
822 extensions::ProcessMap process_map_; | 832 extensions::ProcessMap process_map_; |
823 | 833 |
824 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 834 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
825 InstallAppsWithUnlimtedStorage); | 835 InstallAppsWithUnlimtedStorage); |
826 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 836 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
827 InstallAppsAndCheckStorageProtection); | 837 InstallAppsAndCheckStorageProtection); |
828 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 838 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
829 }; | 839 }; |
830 | 840 |
831 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 841 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
OLD | NEW |