diff options
-rw-r--r-- | chrome/browser/extensions/extension_updater.cc | 4 | ||||
-rw-r--r-- | chrome/common/extensions/extension.h | 16 | ||||
-rw-r--r-- | chrome/common/render_messages_params.cc | 2 |
3 files changed, 16 insertions, 6 deletions
diff --git a/chrome/browser/extensions/extension_updater.cc b/chrome/browser/extensions/extension_updater.cc index 0af7600..abdba15 100644 --- a/chrome/browser/extensions/extension_updater.cc +++ b/chrome/browser/extensions/extension_updater.cc @@ -232,9 +232,7 @@ void ManifestFetchesBuilder::AddExtensionData( PendingExtensionInfo::ExpectedCrxType crx_type, GURL update_url) { - // Only internal and external extensions can be autoupdated. - if (location != Extension::INTERNAL && - !Extension::IsExternalLocation(location)) { + if (!Extension::IsAutoUpdateableLocation(location)) { return; } diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h index db1c0c3..c90928e 100644 --- a/chrome/common/extensions/extension.h +++ b/chrome/common/extensions/extension.h @@ -49,8 +49,12 @@ class Extension { COMPONENT, // An integral component of Chrome itself, which // happens to be implemented as an extension. We don't // show these in the management UI. - EXTERNAL_PREF_DOWNLOAD // A crx file from an external directory (via + EXTERNAL_PREF_DOWNLOAD, // A crx file from an external directory (via // prefs), installed from an update URL. + EXTERNAL_POLICY_DOWNLOAD, // A crx file from an external directory (via + // admin policies), installed from an update URL. + + NUM_LOCATIONS }; enum State { @@ -367,7 +371,15 @@ class Extension { static inline bool IsExternalLocation(Location location) { return location == Extension::EXTERNAL_PREF || location == Extension::EXTERNAL_REGISTRY || - location == Extension::EXTERNAL_PREF_DOWNLOAD; + location == Extension::EXTERNAL_PREF_DOWNLOAD || + location == Extension::EXTERNAL_POLICY_DOWNLOAD; + } + + // Whether extensions with |location| are auto-updatable or not. + static inline bool IsAutoUpdateableLocation(Location location) { + // Only internal and external extensions can be autoupdated. + return location == Extension::INTERNAL || + IsExternalLocation(location); } // See HistogramType definition above. diff --git a/chrome/common/render_messages_params.cc b/chrome/common/render_messages_params.cc index 59802b4..63c37f8 100644 --- a/chrome/common/render_messages_params.cc +++ b/chrome/common/render_messages_params.cc @@ -522,7 +522,7 @@ struct ParamTraits<Extension::Location> { int val = 0; if (!ReadParam(m, iter, &val) || val < Extension::INVALID || - val > Extension::EXTERNAL_PREF_DOWNLOAD) + val >= Extension::NUM_LOCATIONS) return false; *p = static_cast<param_type>(val); return true; |