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 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 class UpdateObserver; | 66 class UpdateObserver; |
67 } // namespace extensions | 67 } // namespace extensions |
68 | 68 |
69 // This is an interface class to encapsulate the dependencies that | 69 // This is an interface class to encapsulate the dependencies that |
70 // various classes have on ExtensionService. This allows easy mocking. | 70 // various classes have on ExtensionService. This allows easy mocking. |
71 class ExtensionServiceInterface | 71 class ExtensionServiceInterface |
72 : public base::SupportsWeakPtr<ExtensionServiceInterface> { | 72 : public base::SupportsWeakPtr<ExtensionServiceInterface> { |
73 public: | 73 public: |
74 virtual ~ExtensionServiceInterface() {} | 74 virtual ~ExtensionServiceInterface() {} |
75 | 75 |
76 // DEPRECATED: Use ExtensionRegistry::enabled_extensions() instead. | |
77 // | |
78 // ExtensionRegistry also has the disabled, terminated and blacklisted sets. | |
79 virtual const extensions::ExtensionSet* extensions() const = 0; | |
80 | |
81 // Gets the object managing the set of pending extensions. | 76 // Gets the object managing the set of pending extensions. |
82 virtual extensions::PendingExtensionManager* pending_extension_manager() = 0; | 77 virtual extensions::PendingExtensionManager* pending_extension_manager() = 0; |
83 | 78 |
84 // Installs an update with the contents from |extension_path|. Returns true if | 79 // Installs an update with the contents from |extension_path|. Returns true if |
85 // the install can be started. Sets |out_crx_installer| to the installer if | 80 // the install can be started. Sets |out_crx_installer| to the installer if |
86 // one was started. | 81 // one was started. |
87 // TODO(aa): This method can be removed. ExtensionUpdater could use | 82 // TODO(aa): This method can be removed. ExtensionUpdater could use |
88 // CrxInstaller directly instead. | 83 // CrxInstaller directly instead. |
89 virtual bool UpdateExtension( | 84 virtual bool UpdateExtension( |
90 const std::string& id, | 85 const std::string& id, |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 extensions::Blacklist* blacklist, | 193 extensions::Blacklist* blacklist, |
199 bool autoupdate_enabled, | 194 bool autoupdate_enabled, |
200 bool extensions_enabled, | 195 bool extensions_enabled, |
201 extensions::OneShotEvent* ready); | 196 extensions::OneShotEvent* ready); |
202 | 197 |
203 ~ExtensionService() override; | 198 ~ExtensionService() override; |
204 | 199 |
205 // ExtensionServiceInterface implementation. | 200 // ExtensionServiceInterface implementation. |
206 // | 201 // |
207 // NOTE: Many of these methods are DEPRECATED. See the interface for details. | 202 // NOTE: Many of these methods are DEPRECATED. See the interface for details. |
208 const extensions::ExtensionSet* extensions() const override; | |
209 extensions::PendingExtensionManager* pending_extension_manager() override; | 203 extensions::PendingExtensionManager* pending_extension_manager() override; |
210 const extensions::Extension* GetExtensionById( | 204 const extensions::Extension* GetExtensionById( |
211 const std::string& id, | 205 const std::string& id, |
212 bool include_disabled) const override; | 206 bool include_disabled) const override; |
213 const extensions::Extension* GetInstalledExtension( | 207 const extensions::Extension* GetInstalledExtension( |
214 const std::string& id) const override; | 208 const std::string& id) const override; |
215 bool UpdateExtension(const std::string& id, | 209 bool UpdateExtension(const std::string& id, |
216 const base::FilePath& extension_path, | 210 const base::FilePath& extension_path, |
217 bool file_ownership_passed, | 211 bool file_ownership_passed, |
218 extensions::CrxInstaller** out_crx_installer) override; | 212 extensions::CrxInstaller** out_crx_installer) override; |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
733 GreylistedExtensionDisabled); | 727 GreylistedExtensionDisabled); |
734 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 728 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
735 GreylistDontEnableManuallyDisabled); | 729 GreylistDontEnableManuallyDisabled); |
736 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 730 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
737 GreylistUnknownDontChange); | 731 GreylistUnknownDontChange); |
738 | 732 |
739 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 733 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
740 }; | 734 }; |
741 | 735 |
742 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 736 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
OLD | NEW |