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

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

Issue 196663003: Introduce an extension parameter which is used to customize the extension. It's available for exter… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Modified test parameters Created 6 years, 9 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/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 962a0501bc364c32ae95b00fcba82d069f6655ba..286ef95f8bfe8c2c81877f3f02d59314fa1091fe 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -265,6 +265,7 @@ void ExtensionService::AddProviderForTesting(
bool ExtensionService::OnExternalExtensionUpdateUrlFound(
const std::string& id,
+ const std::string& install_parameter,
const GURL& update_url,
Manifest::Location location,
int creation_flags,
@@ -292,7 +293,12 @@ bool ExtensionService::OnExternalExtensionUpdateUrlFound(
// source. In this case, signal that this extension will not be
// installed by returning false.
if (!pending_extension_manager()->AddFromExternalUpdateUrl(
- id, update_url, location, creation_flags, mark_acknowledged)) {
+ id,
+ install_parameter,
+ update_url,
+ location,
+ creation_flags,
+ mark_acknowledged)) {
return false;
}
@@ -1823,7 +1829,8 @@ void ExtensionService::AddComponentExtension(const Extension* extension) {
AddNewOrUpdatedExtension(extension,
Extension::ENABLED_COMPONENT,
extensions::NOT_BLACKLISTED,
- syncer::StringOrdinal());
+ syncer::StringOrdinal(),
+ std::string());
return;
}
@@ -2083,6 +2090,7 @@ void ExtensionService::OnExtensionInstalled(
const std::string& id = extension->id();
bool initial_enable = ShouldEnableOnInstall(extension);
+ std::string install_parameter;
const extensions::PendingExtensionInfo* pending_extension_info = NULL;
if ((pending_extension_info = pending_extension_manager()->GetById(id))) {
if (!pending_extension_info->ShouldAllowInstall(extension)) {
@@ -2105,6 +2113,7 @@ void ExtensionService::OnExtensionInstalled(
return;
}
+ install_parameter = pending_extension_info->install_parameter();
pending_extension_manager()->Remove(id);
} else {
// We explicitly want to re-enable an uninstalled external
@@ -2170,7 +2179,8 @@ void ExtensionService::OnExtensionInstalled(
initial_state,
blacklisted_for_malware,
extensions::ExtensionPrefs::DELAY_REASON_WAIT_FOR_IDLE,
- page_ordinal);
+ page_ordinal,
+ install_parameter);
// Transfer ownership of |extension|.
delayed_installs_.Insert(extension);
@@ -2188,7 +2198,8 @@ void ExtensionService::OnExtensionInstalled(
initial_state,
blacklisted_for_malware,
extensions::ExtensionPrefs::DELAY_REASON_GC,
- page_ordinal);
+ page_ordinal,
+ install_parameter);
delayed_installs_.Insert(extension);
} else if (status != IMPORT_STATUS_OK) {
if (status == IMPORT_STATUS_UNSATISFIED) {
@@ -2197,14 +2208,16 @@ void ExtensionService::OnExtensionInstalled(
initial_state,
blacklisted_for_malware,
extensions::ExtensionPrefs::DELAY_REASON_WAIT_FOR_IMPORTS,
- page_ordinal);
+ page_ordinal,
+ install_parameter);
delayed_installs_.Insert(extension);
}
} else {
AddNewOrUpdatedExtension(extension,
initial_state,
blacklist_state,
- page_ordinal);
+ page_ordinal,
+ install_parameter);
}
}
@@ -2212,14 +2225,16 @@ void ExtensionService::AddNewOrUpdatedExtension(
const Extension* extension,
Extension::State initial_state,
extensions::BlacklistState blacklist_state,
- const syncer::StringOrdinal& page_ordinal) {
+ const syncer::StringOrdinal& page_ordinal,
+ const std::string& install_parameter) {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
const bool blacklisted_for_malware =
blacklist_state == extensions::BLACKLISTED_MALWARE;
extension_prefs_->OnExtensionInstalled(extension,
initial_state,
blacklisted_for_malware,
- page_ordinal);
+ page_ordinal,
+ install_parameter);
delayed_installs_.Remove(extension->id());
if (InstallVerifier::NeedsVerification(*extension)) {
system_->install_verifier()->Add(extension->id(),
« no previous file with comments | « chrome/browser/extensions/extension_service.h ('k') | chrome/browser/extensions/extension_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698