| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |