diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-16 03:44:22 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-16 03:44:22 +0000 |
commit | 7a4c685b6ea64503334571fdafff5b2be684b9cc (patch) | |
tree | 53c383afd6d3650f54e08319e83578467cfe1132 /chrome/browser/extensions/extensions_service.h | |
parent | e4fff0448ad3ad8f5142d01d8fde0be5b887d639 (diff) | |
download | chromium_src-7a4c685b6ea64503334571fdafff5b2be684b9cc.zip chromium_src-7a4c685b6ea64503334571fdafff5b2be684b9cc.tar.gz chromium_src-7a4c685b6ea64503334571fdafff5b2be684b9cc.tar.bz2 |
Move ExtensionsServiceBackend class into the .cc file.
(Note: This was a TODO for Aaron).
BUG=None
TEST=trybots
Review URL: http://codereview.chromium.org/3429003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59613 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extensions_service.h')
-rw-r--r-- | chrome/browser/extensions/extensions_service.h | 113 |
1 files changed, 0 insertions, 113 deletions
diff --git a/chrome/browser/extensions/extensions_service.h b/chrome/browser/extensions/extensions_service.h index ad02d57..4efa84a 100644 --- a/chrome/browser/extensions/extensions_service.h +++ b/chrome/browser/extensions/extensions_service.h @@ -517,117 +517,4 @@ class ExtensionsService DISALLOW_COPY_AND_ASSIGN(ExtensionsService); }; -// Implements IO for the ExtensionsService. -// TODO(aa): This can probably move into the .cc file. -class ExtensionsServiceBackend - : public base::RefCountedThreadSafe<ExtensionsServiceBackend>, - public ExternalExtensionProvider::Visitor { - public: - // |rdh| can be NULL in the case of test environment. - // |extension_prefs| contains a dictionary value that points to the extension - // preferences. - explicit ExtensionsServiceBackend(const FilePath& install_directory); - - // Loads a single extension from |path| where |path| is the top directory of - // a specific extension where its manifest file lives. - // Errors are reported through ExtensionErrorReporter. On success, - // OnExtensionLoaded() is called. - // TODO(erikkay): It might be useful to be able to load a packed extension - // (presumably into memory) without installing it. - void LoadSingleExtension(const FilePath &path, - scoped_refptr<ExtensionsService> frontend); - - // Check externally updated extensions for updates and install if necessary. - // Errors are reported through ExtensionErrorReporter. Succcess is not - // reported. - void CheckForExternalUpdates(std::set<std::string> ids_to_ignore, - scoped_refptr<ExtensionsService> frontend); - - // For the extension in |version_path| with |id|, check to see if it's an - // externally managed extension. If so, tell the frontend to uninstall it. - void CheckExternalUninstall(scoped_refptr<ExtensionsService> frontend, - const std::string& id, - Extension::Location location); - - // Clear all ExternalExtensionProviders. - void ClearProvidersForTesting(); - - // Sets an ExternalExtensionProvider for the service to use during testing. - // |location| specifies what type of provider should be added. - void SetProviderForTesting(Extension::Location location, - ExternalExtensionProvider* test_provider); - - // ExternalExtensionProvider::Visitor implementation. - virtual void OnExternalExtensionFileFound(const std::string& id, - const Version* version, - const FilePath& path, - Extension::Location location); - - virtual void OnExternalExtensionUpdateUrlFound( - const std::string& id, - const GURL& update_url, - bool enable_incognito_on_install); - - // Reloads the given extensions from their manifests on disk (instead of what - // we have cached in the prefs). - void ReloadExtensionManifests( - ExtensionPrefs::ExtensionsInfo* extensions_to_reload, - base::TimeTicks start_time, - scoped_refptr<ExtensionsService> frontend); - - private: - friend class base::RefCountedThreadSafe<ExtensionsServiceBackend>; - - virtual ~ExtensionsServiceBackend(); - - // Finish installing the extension in |crx_path| after it has been unpacked to - // |unpacked_path|. If |expected_id| is not empty, it's verified against the - // extension's manifest before installation. If |silent| is true, there will - // be no install confirmation dialog. |from_gallery| indicates whether the - // crx was installed from our gallery, which results in different UI. - // - // Note: We take ownership of |extension|. - void OnExtensionUnpacked( - const FilePath& crx_path, - const FilePath& unpacked_path, - Extension* extension, - const std::string expected_id); - - // Notify the frontend that there was an error loading an extension. - void ReportExtensionLoadError(const FilePath& extension_path, - const std::string& error); - - // Lookup an external extension by |id| by going through all registered - // external extension providers until we find a provider that contains an - // extension that matches. If |version| is not NULL, the extension version - // will be returned (caller is responsible for deleting that pointer). - // |location| can also be null, if not needed. Returns true if extension is - // found, false otherwise. - bool LookupExternalExtension(const std::string& id, - Version** version, - Extension::Location* location); - - // This is a naked pointer which is set by each entry point. - // The entry point is responsible for ensuring lifetime. - ExtensionsService* frontend_; - - // The top-level extensions directory being installed to. - FilePath install_directory_; - - // Whether errors result in noisy alerts. - bool alert_on_error_; - - // A map of all external extension providers. - typedef std::map<Extension::Location, - linked_ptr<ExternalExtensionProvider> > ProviderMap; - ProviderMap external_extension_providers_; - - // Set to true by OnExternalExtensionUpdateUrlFound() when an external - // extension URL is found. Used in CheckForExternalUpdates() to see - // if an update check is needed to install pending extensions. - bool external_extension_added_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionsServiceBackend); -}; - #endif // CHROME_BROWSER_EXTENSIONS_EXTENSIONS_SERVICE_H_ |