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

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

Issue 12792005: Allow extensions on chrome:// URLs, when flag is set and permission is explicitly requested (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reinstate original pickle order; add scripts clause to content_script_chrome_url_invalid.json to av… Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 if (extension->UpdatesFromGallery()) { 318 if (extension->UpdatesFromGallery()) {
319 return CrxInstallerError( 319 return CrxInstallerError(
320 l10n_util::GetStringFUTF16( 320 l10n_util::GetStringFUTF16(
321 IDS_EXTENSION_DISALLOW_NON_DOWNLOADED_GALLERY_INSTALLS, 321 IDS_EXTENSION_DISALLOW_NON_DOWNLOADED_GALLERY_INSTALLS,
322 l10n_util::GetStringUTF16(IDS_EXTENSION_WEB_STORE_TITLE))); 322 l10n_util::GetStringUTF16(IDS_EXTENSION_WEB_STORE_TITLE)));
323 } 323 }
324 324
325 // For self-hosted apps, verify that the entire extent is on the same 325 // For self-hosted apps, verify that the entire extent is on the same
326 // host (or a subdomain of the host) the download happened from. There's 326 // host (or a subdomain of the host) the download happened from. There's
327 // no way for us to verify that the app controls any other hosts. 327 // no way for us to verify that the app controls any other hosts.
328 URLPattern pattern(UserScript::kValidUserScriptSchemes); 328 URLPattern pattern(UserScript::ValidUserScriptSchemes());
329 pattern.SetHost(download_url_.host()); 329 pattern.SetHost(download_url_.host());
330 pattern.SetMatchSubdomains(true); 330 pattern.SetMatchSubdomains(true);
331 331
332 URLPatternSet patterns = extension_->web_extent(); 332 URLPatternSet patterns = extension_->web_extent();
333 for (URLPatternSet::const_iterator i = patterns.begin(); 333 for (URLPatternSet::const_iterator i = patterns.begin();
334 i != patterns.end(); ++i) { 334 i != patterns.end(); ++i) {
335 if (!pattern.MatchesHost(i->host())) { 335 if (!pattern.MatchesHost(i->host())) {
336 return CrxInstallerError( 336 return CrxInstallerError(
337 l10n_util::GetStringUTF16( 337 l10n_util::GetStringUTF16(
338 IDS_EXTENSION_INSTALL_INCORRECT_INSTALL_HOST)); 338 IDS_EXTENSION_INSTALL_INCORRECT_INSTALL_HOST));
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
805 if (!prefs->DidExtensionEscalatePermissions(extension_->id())) 805 if (!prefs->DidExtensionEscalatePermissions(extension_->id()))
806 return; 806 return;
807 807
808 if (client_) { 808 if (client_) {
809 AddRef(); // Balanced in InstallUIProceed() and InstallUIAbort(). 809 AddRef(); // Balanced in InstallUIProceed() and InstallUIAbort().
810 client_->ConfirmReEnable(this, extension_.get()); 810 client_->ConfirmReEnable(this, extension_.get());
811 } 811 }
812 } 812 }
813 813
814 } // namespace extensions 814 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/active_tab_permission_granter.cc ('k') | chrome/browser/extensions/extension_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698