summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/crx_installer.cc
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-25 08:31:43 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-25 08:31:43 +0000
commit3b76103e0186e3ac2b67373b6f35f81a44d986c8 (patch)
treec03154bfa6d381f1279d46282009fdd37ac6e4ef /chrome/browser/extensions/crx_installer.cc
parent75709691d97122dbefd7d73ce0cfade557e498b5 (diff)
downloadchromium_src-3b76103e0186e3ac2b67373b6f35f81a44d986c8.zip
chromium_src-3b76103e0186e3ac2b67373b6f35f81a44d986c8.tar.gz
chromium_src-3b76103e0186e3ac2b67373b6f35f81a44d986c8.tar.bz2
Revert r50834
TBR=tony@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50835 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/crx_installer.cc')
-rw-r--r--chrome/browser/extensions/crx_installer.cc28
1 files changed, 9 insertions, 19 deletions
diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc
index 70f8146..3609320 100644
--- a/chrome/browser/extensions/crx_installer.cc
+++ b/chrome/browser/extensions/crx_installer.cc
@@ -43,7 +43,7 @@ CrxInstaller::CrxInstaller(const FilePath& install_directory,
install_source_(Extension::INTERNAL),
delete_source_(false),
allow_privilege_increase_(false),
- limit_web_extent_to_download_host_(false),
+ force_web_origin_to_download_url_(false),
create_app_shortcut_(false),
frontend_(frontend),
client_(client) {
@@ -84,6 +84,10 @@ void CrxInstaller::InstallCrx(const FilePath& source_file) {
g_browser_process->resource_dispatcher_host(),
this));
+ if (force_web_origin_to_download_url_) {
+ unpacker->set_web_origin(original_url_.GetOrigin());
+ }
+
ChromeThread::PostTask(
ChromeThread::FILE, FROM_HERE,
NewRunnableMethod(
@@ -160,22 +164,6 @@ void CrxInstaller::OnUnpackSuccess(const FilePath& temp_dir,
return;
}
- // Require that apps are served from the domain they claim in their extent,
- // or some ancestor domain.
- if (extension_->is_app() && limit_web_extent_to_download_host_) {
- URLPattern pattern;
- pattern.set_host(original_url_.host());
- pattern.set_match_subdomains(true);
-
- for (size_t i = 0; i < extension_->web_extent().patterns().size(); ++i) {
- if (!pattern.MatchesHost(extension_->web_extent().patterns()[i].host())) {
- ReportFailureFromFileThread(StringPrintf(
- "Apps must be served from the host that they affect."));
- return;
- }
- }
- }
-
if (client_ || extension_->GetFullLaunchURL().is_valid()) {
Extension::DecodeIcon(extension_.get(), Extension::EXTENSION_ICON_LARGE,
&install_icon_);
@@ -197,11 +185,13 @@ void CrxInstaller::ConfirmInstall() {
GURL overlapping_url;
Extension* overlapping_extension =
- frontend_->GetExtensionByOverlappingWebExtent(extension_->web_extent());
+ frontend_->GetExtensionByOverlappingWebExtent(
+ extension_->web_extent(), &overlapping_url);
if (overlapping_extension) {
ReportFailureFromUIThread(l10n_util::GetStringFUTF8(
IDS_EXTENSION_OVERLAPPING_WEB_EXTENT,
- UTF8ToUTF16(overlapping_extension->name())));
+ UTF8ToUTF16(overlapping_extension->name()),
+ UTF8ToUTF16(overlapping_url.spec())));
return;
}