Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1646)

Unified Diff: chrome/browser/extensions/external_provider_impl.cc

Issue 479513004: Prevent extension sideloading from Windows registry (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/external_provider_impl.cc
diff --git a/chrome/browser/extensions/external_provider_impl.cc b/chrome/browser/extensions/external_provider_impl.cc
index 271d0a401121cc2ff5dab6711496f936c7f66f30..13914f4d4685df354bf922a38a28533130af61a8 100644
--- a/chrome/browser/extensions/external_provider_impl.cc
+++ b/chrome/browser/extensions/external_provider_impl.cc
@@ -66,6 +66,7 @@ const char ExternalProviderImpl::kIsFromWebstore[] = "is_from_webstore";
const char ExternalProviderImpl::kKeepIfPresent[] = "keep_if_present";
const char ExternalProviderImpl::kWasInstalledByOem[] = "was_installed_by_oem";
const char ExternalProviderImpl::kSupportedLocales[] = "supported_locales";
+const char ExternalProviderImpl::kMayBeUntrusted[] = "may_be_untrusted";
ExternalProviderImpl::ExternalProviderImpl(
VisitorInterface* service,
@@ -204,12 +205,12 @@ void ExternalProviderImpl::SetPrefs(base::DictionaryValue* prefs) {
is_bookmark_app) {
creation_flags |= Extension::FROM_BOOKMARK;
}
- bool is_from_webstore;
+ bool is_from_webstore = false;
if (extension->GetBoolean(kIsFromWebstore, &is_from_webstore) &&
is_from_webstore) {
creation_flags |= Extension::FROM_WEBSTORE;
}
- bool keep_if_present;
+ bool keep_if_present = false;
if (extension->GetBoolean(kKeepIfPresent, &keep_if_present) &&
keep_if_present && profile_) {
ExtensionServiceInterface* extension_service =
@@ -223,11 +224,16 @@ void ExternalProviderImpl::SetPrefs(base::DictionaryValue* prefs) {
continue;
}
}
- bool was_installed_by_oem;
+ bool was_installed_by_oem = false;
if (extension->GetBoolean(kWasInstalledByOem, &was_installed_by_oem) &&
was_installed_by_oem) {
creation_flags |= Extension::WAS_INSTALLED_BY_OEM;
}
+ bool may_be_untrusted = false;
+ if (extension->GetBoolean(kMayBeUntrusted, &may_be_untrusted) &&
+ may_be_untrusted) {
+ creation_flags |= Extension::MAY_BE_UNTRUSTED;
+ }
std::string install_parameter;
extension->GetString(kInstallParam, &install_parameter);

Powered by Google App Engine
This is Rietveld 408576698