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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 extensions::Blacklist* blacklist, | 194 extensions::Blacklist* blacklist, |
195 bool autoupdate_enabled, | 195 bool autoupdate_enabled, |
196 bool extensions_enabled, | 196 bool extensions_enabled, |
197 extensions::OneShotEvent* ready); | 197 extensions::OneShotEvent* ready); |
198 | 198 |
199 virtual ~ExtensionService(); | 199 virtual ~ExtensionService(); |
200 | 200 |
201 // ExtensionServiceInterface implementation. | 201 // ExtensionServiceInterface implementation. |
202 // | 202 // |
203 // NOTE: Many of these methods are DEPRECATED. See the interface for details. | 203 // NOTE: Many of these methods are DEPRECATED. See the interface for details. |
204 virtual const extensions::ExtensionSet* extensions() const OVERRIDE; | 204 virtual const extensions::ExtensionSet* extensions() const override; |
205 virtual extensions::PendingExtensionManager* | 205 virtual extensions::PendingExtensionManager* |
206 pending_extension_manager() OVERRIDE; | 206 pending_extension_manager() override; |
207 virtual const extensions::Extension* GetExtensionById( | 207 virtual const extensions::Extension* GetExtensionById( |
208 const std::string& id, bool include_disabled) const OVERRIDE; | 208 const std::string& id, bool include_disabled) const override; |
209 virtual const extensions::Extension* GetInstalledExtension( | 209 virtual const extensions::Extension* GetInstalledExtension( |
210 const std::string& id) const OVERRIDE; | 210 const std::string& id) const override; |
211 virtual bool UpdateExtension( | 211 virtual bool UpdateExtension( |
212 const std::string& id, | 212 const std::string& id, |
213 const base::FilePath& extension_path, | 213 const base::FilePath& extension_path, |
214 bool file_ownership_passed, | 214 bool file_ownership_passed, |
215 extensions::CrxInstaller** out_crx_installer) OVERRIDE; | 215 extensions::CrxInstaller** out_crx_installer) override; |
216 virtual bool IsExtensionEnabled( | 216 virtual bool IsExtensionEnabled( |
217 const std::string& extension_id) const OVERRIDE; | 217 const std::string& extension_id) const override; |
218 virtual void UnloadExtension( | 218 virtual void UnloadExtension( |
219 const std::string& extension_id, | 219 const std::string& extension_id, |
220 extensions::UnloadedExtensionInfo::Reason reason) OVERRIDE; | 220 extensions::UnloadedExtensionInfo::Reason reason) override; |
221 virtual void RemoveComponentExtension(const std::string& extension_id) | 221 virtual void RemoveComponentExtension(const std::string& extension_id) |
222 OVERRIDE; | 222 override; |
223 virtual void AddExtension(const extensions::Extension* extension) OVERRIDE; | 223 virtual void AddExtension(const extensions::Extension* extension) override; |
224 virtual void AddComponentExtension(const extensions::Extension* extension) | 224 virtual void AddComponentExtension(const extensions::Extension* extension) |
225 OVERRIDE; | 225 override; |
226 virtual const extensions::Extension* GetPendingExtensionUpdate( | 226 virtual const extensions::Extension* GetPendingExtensionUpdate( |
227 const std::string& extension_id) const OVERRIDE; | 227 const std::string& extension_id) const override; |
228 virtual void FinishDelayedInstallation( | 228 virtual void FinishDelayedInstallation( |
229 const std::string& extension_id) OVERRIDE; | 229 const std::string& extension_id) override; |
230 virtual void CheckManagementPolicy() OVERRIDE; | 230 virtual void CheckManagementPolicy() override; |
231 virtual void CheckForUpdatesSoon() OVERRIDE; | 231 virtual void CheckForUpdatesSoon() override; |
232 virtual bool is_ready() OVERRIDE; | 232 virtual bool is_ready() override; |
233 virtual base::SequencedTaskRunner* GetFileTaskRunner() OVERRIDE; | 233 virtual base::SequencedTaskRunner* GetFileTaskRunner() override; |
234 | 234 |
235 // ExternalProvider::Visitor implementation. | 235 // ExternalProvider::Visitor implementation. |
236 // Exposed for testing. | 236 // Exposed for testing. |
237 virtual bool OnExternalExtensionFileFound( | 237 virtual bool OnExternalExtensionFileFound( |
238 const std::string& id, | 238 const std::string& id, |
239 const base::Version* version, | 239 const base::Version* version, |
240 const base::FilePath& path, | 240 const base::FilePath& path, |
241 extensions::Manifest::Location location, | 241 extensions::Manifest::Location location, |
242 int creation_flags, | 242 int creation_flags, |
243 bool mark_acknowledged) OVERRIDE; | 243 bool mark_acknowledged) override; |
244 virtual bool OnExternalExtensionUpdateUrlFound( | 244 virtual bool OnExternalExtensionUpdateUrlFound( |
245 const std::string& id, | 245 const std::string& id, |
246 const std::string& install_parameter, | 246 const std::string& install_parameter, |
247 const GURL& update_url, | 247 const GURL& update_url, |
248 extensions::Manifest::Location location, | 248 extensions::Manifest::Location location, |
249 int creation_flags, | 249 int creation_flags, |
250 bool mark_acknowledged) OVERRIDE; | 250 bool mark_acknowledged) override; |
251 virtual void OnExternalProviderReady( | 251 virtual void OnExternalProviderReady( |
252 const extensions::ExternalProviderInterface* provider) OVERRIDE; | 252 const extensions::ExternalProviderInterface* provider) override; |
253 | 253 |
254 // ExtensionManagement::Observer implementation: | 254 // ExtensionManagement::Observer implementation: |
255 virtual void OnExtensionManagementSettingsChanged() OVERRIDE; | 255 virtual void OnExtensionManagementSettingsChanged() override; |
256 | 256 |
257 // Initialize and start all installed extensions. | 257 // Initialize and start all installed extensions. |
258 void Init(); | 258 void Init(); |
259 | 259 |
260 // Called when the associated Profile is going to be destroyed. | 260 // Called when the associated Profile is going to be destroyed. |
261 void Shutdown(); | 261 void Shutdown(); |
262 | 262 |
263 // Reloads the specified extension, sending the onLaunched() event to it if it | 263 // Reloads the specified extension, sending the onLaunched() event to it if it |
264 // currently has any window showing. | 264 // currently has any window showing. |
265 // Allows noisy failures. | 265 // Allows noisy failures. |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 extensions::ExtensionDownloaderDelegate* delegate); | 476 extensions::ExtensionDownloaderDelegate* delegate); |
477 | 477 |
478 // Reloads the specified extension, sending the onLaunched() event to it if it | 478 // Reloads the specified extension, sending the onLaunched() event to it if it |
479 // currently has any window showing. |be_noisy| determines whether noisy | 479 // currently has any window showing. |be_noisy| determines whether noisy |
480 // failures are allowed for unpacked extension installs. | 480 // failures are allowed for unpacked extension installs. |
481 void ReloadExtensionImpl(const std::string& extension_id, bool be_noisy); | 481 void ReloadExtensionImpl(const std::string& extension_id, bool be_noisy); |
482 | 482 |
483 // content::NotificationObserver implementation: | 483 // content::NotificationObserver implementation: |
484 virtual void Observe(int type, | 484 virtual void Observe(int type, |
485 const content::NotificationSource& source, | 485 const content::NotificationSource& source, |
486 const content::NotificationDetails& details) OVERRIDE; | 486 const content::NotificationDetails& details) override; |
487 | 487 |
488 // extensions::Blacklist::Observer implementation. | 488 // extensions::Blacklist::Observer implementation. |
489 virtual void OnBlacklistUpdated() OVERRIDE; | 489 virtual void OnBlacklistUpdated() override; |
490 | 490 |
491 // Similar to FinishInstallation, but first checks if there still is an update | 491 // Similar to FinishInstallation, but first checks if there still is an update |
492 // pending for the extension, and makes sure the extension is still idle. | 492 // pending for the extension, and makes sure the extension is still idle. |
493 void MaybeFinishDelayedInstallation(const std::string& extension_id); | 493 void MaybeFinishDelayedInstallation(const std::string& extension_id); |
494 | 494 |
495 // For the extension in |version_path| with |id|, check to see if it's an | 495 // For the extension in |version_path| with |id|, check to see if it's an |
496 // externally managed extension. If so, uninstall it. | 496 // externally managed extension. If so, uninstall it. |
497 void CheckExternalUninstall(const std::string& id); | 497 void CheckExternalUninstall(const std::string& id); |
498 | 498 |
499 // Populates greylist_. | 499 // Populates greylist_. |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 GreylistedExtensionDisabled); | 735 GreylistedExtensionDisabled); |
736 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 736 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
737 GreylistDontEnableManuallyDisabled); | 737 GreylistDontEnableManuallyDisabled); |
738 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 738 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
739 GreylistUnknownDontChange); | 739 GreylistUnknownDontChange); |
740 | 740 |
741 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 741 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
742 }; | 742 }; |
743 | 743 |
744 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 744 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
OLD | NEW |