diff options
author | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-21 19:40:08 +0000 |
---|---|---|
committer | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-21 19:40:08 +0000 |
commit | 7fa19f8c525235f3318359b4e6f647e1dfd18f46 (patch) | |
tree | 83b8148a77823c65c8f74aba0a079bc4b1e94bd1 /chrome/browser/extensions/extension_service.h | |
parent | 0ff0ff32b0b9f301200cb4e595fef541118a2987 (diff) | |
download | chromium_src-7fa19f8c525235f3318359b4e6f647e1dfd18f46.zip chromium_src-7fa19f8c525235f3318359b4e6f647e1dfd18f46.tar.gz chromium_src-7fa19f8c525235f3318359b4e6f647e1dfd18f46.tar.bz2 |
Coalesced various extension type enums into Extension::Type.
Renamed Extension::HistogramType to Extension::Type and used it
everywhere.
Moved extension sync security checks into sync land and simplified them.
BUG=55823
TEST=Existing unit tests / sync integration tests
Review URL: http://codereview.chromium.org/5946001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69855 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_service.h')
-rw-r--r-- | chrome/browser/extensions/extension_service.h | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/chrome/browser/extensions/extension_service.h b/chrome/browser/extensions/extension_service.h index defa10a..2ae45ef 100644 --- a/chrome/browser/extensions/extension_service.h +++ b/chrome/browser/extensions/extension_service.h @@ -41,33 +41,29 @@ class GURL; class Profile; class Version; +typedef bool (*ShouldInstallExtensionPredicate)(const Extension&); + // A pending extension is an extension that hasn't been installed yet // and is intended to be installed in the next auto-update cycle. The // update URL of a pending extension may be blank, in which case a // default one is assumed. struct PendingExtensionInfo { - // TODO(skerner): Consider merging ExpectedCrxType with - // browser_sync::ExtensionType. - enum ExpectedCrxType { - UNKNOWN, // Sometimes we don't know the type of a pending item. An - // update URL from external_extensions.json is one such case. - APP, - THEME, - EXTENSION - }; - - PendingExtensionInfo(const GURL& update_url, - ExpectedCrxType expected_crx_type, - bool is_from_sync, - bool install_silently, - bool enable_on_install, - bool enable_incognito_on_install, - Extension::Location install_source); + PendingExtensionInfo( + const GURL& update_url, + ShouldInstallExtensionPredicate should_install_extension, + bool is_from_sync, + bool install_silently, + bool enable_on_install, + bool enable_incognito_on_install, + Extension::Location install_source); PendingExtensionInfo(); GURL update_url; - ExpectedCrxType expected_crx_type; + // When the extension is about to be installed, this function is + // called. If this function returns true, the install proceeds. If + // this function returns false, the install is aborted. + ShouldInstallExtensionPredicate should_install_extension; bool is_from_sync; // This update check was initiated from sync. bool install_silently; bool enable_on_install; @@ -242,7 +238,7 @@ class ExtensionService // pre-enabled permissions. void AddPendingExtensionFromSync( const std::string& id, const GURL& update_url, - const PendingExtensionInfo::ExpectedCrxType expected_crx_type, + ShouldInstallExtensionPredicate should_install_extension, bool install_silently, bool enable_on_install, bool enable_incognito_on_install); @@ -471,11 +467,11 @@ class ExtensionService bool include_enabled, bool include_disabled); - // Like AddPendingExtension() but assumes an extension with the same - // id is not already installed. + // Like AddPendingExtension*() functions above, but assumes an + // extension with the same id is not already installed. void AddPendingExtensionInternal( const std::string& id, const GURL& update_url, - PendingExtensionInfo::ExpectedCrxType crx_type, + ShouldInstallExtensionPredicate should_install_extension, bool is_from_sync, bool install_silently, bool enable_on_install, bool enable_incognito_on_install, Extension::Location install_source); |