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

Side by Side Diff: chrome/browser/extensions/crx_installer.cc

Issue 3039005: Fix some issues with extensions: (Closed)
Patch Set: fix host perms Created 10 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/extensions_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/crx_installer.h" 5 #include "chrome/browser/extensions/crx_installer.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "app/resource_bundle.h" 8 #include "app/resource_bundle.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 ReportFailureFromFileThread(StringPrintf( 161 ReportFailureFromFileThread(StringPrintf(
162 "ID in new extension manifest (%s) does not match expected id (%s)", 162 "ID in new extension manifest (%s) does not match expected id (%s)",
163 extension->id().c_str(), 163 extension->id().c_str(),
164 expected_id_.c_str())); 164 expected_id_.c_str()));
165 return; 165 return;
166 } 166 }
167 167
168 // Require that apps are served from the domain they claim in their extent, 168 // Require that apps are served from the domain they claim in their extent,
169 // or some ancestor domain. 169 // or some ancestor domain.
170 if (extension_->is_app() && limit_web_extent_to_download_host_) { 170 if (extension_->is_app() && limit_web_extent_to_download_host_) {
171 URLPattern pattern(URLPattern::SCHEMES_ALL); 171 URLPattern pattern(UserScript::kValidUserScriptSchemes);
172 pattern.set_host(original_url_.host()); 172 pattern.set_host(original_url_.host());
173 pattern.set_match_subdomains(true); 173 pattern.set_match_subdomains(true);
174 174
175 for (size_t i = 0; i < extension_->web_extent().patterns().size(); ++i) { 175 for (size_t i = 0; i < extension_->web_extent().patterns().size(); ++i) {
176 if (!pattern.MatchesHost(extension_->web_extent().patterns()[i].host())) { 176 if (!pattern.MatchesHost(extension_->web_extent().patterns()[i].host())) {
177 ReportFailureFromFileThread(StringPrintf( 177 ReportFailureFromFileThread(StringPrintf(
178 "Apps must be served from the host that they affect.")); 178 "Apps must be served from the host that they affect."));
179 return; 179 return;
180 } 180 }
181 } 181 }
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 client_->OnInstallSuccess(extension_.get()); 347 client_->OnInstallSuccess(extension_.get());
348 348
349 // Tell the frontend about the installation and hand off ownership of 349 // Tell the frontend about the installation and hand off ownership of
350 // extension_ to it. 350 // extension_ to it.
351 frontend_->OnExtensionInstalled(extension_.release(), 351 frontend_->OnExtensionInstalled(extension_.release(),
352 allow_privilege_increase_); 352 allow_privilege_increase_);
353 353
354 // We're done. We don't post any more tasks to ourselves so we are deleted 354 // We're done. We don't post any more tasks to ourselves so we are deleted
355 // soon. 355 // soon.
356 } 356 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extensions_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698