| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/webstore_inline_installer.h" | 5 #include "chrome/browser/extensions/webstore_inline_installer.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 } | 290 } |
| 291 | 291 |
| 292 // Verified site is required | 292 // Verified site is required |
| 293 if (webstore_data->HasKey(kVerifiedSiteKey)) { | 293 if (webstore_data->HasKey(kVerifiedSiteKey)) { |
| 294 std::string verified_site_domain; | 294 std::string verified_site_domain; |
| 295 if (!webstore_data->GetString(kVerifiedSiteKey, &verified_site_domain)) { | 295 if (!webstore_data->GetString(kVerifiedSiteKey, &verified_site_domain)) { |
| 296 CompleteInstall(kInvalidWebstoreResponseError); | 296 CompleteInstall(kInvalidWebstoreResponseError); |
| 297 return; | 297 return; |
| 298 } | 298 } |
| 299 | 299 |
| 300 URLPattern verified_site_pattern(URLPattern::SCHEME_ALL); | 300 URLPattern verified_site_pattern(URLPattern::ERROR_ON_PORTS, |
| 301 URLPattern::SCHEME_ALL); |
| 301 verified_site_pattern.SetScheme("*"); | 302 verified_site_pattern.SetScheme("*"); |
| 302 verified_site_pattern.SetHost(verified_site_domain); | 303 verified_site_pattern.SetHost(verified_site_domain); |
| 303 verified_site_pattern.SetMatchSubdomains(true); | 304 verified_site_pattern.SetMatchSubdomains(true); |
| 304 verified_site_pattern.SetPath("/*"); | 305 verified_site_pattern.SetPath("/*"); |
| 305 | 306 |
| 306 if (!verified_site_pattern.MatchesURL(requestor_url_)) { | 307 if (!verified_site_pattern.MatchesURL(requestor_url_)) { |
| 307 CompleteInstall(kNotFromVerifiedSiteError); | 308 CompleteInstall(kNotFromVerifiedSiteError); |
| 308 return; | 309 return; |
| 309 } | 310 } |
| 310 } else { | 311 } else { |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 if (tab_contents()) { | 428 if (tab_contents()) { |
| 428 if (error.empty()) { | 429 if (error.empty()) { |
| 429 delegate_->OnInlineInstallSuccess(install_id_); | 430 delegate_->OnInlineInstallSuccess(install_id_); |
| 430 } else { | 431 } else { |
| 431 delegate_->OnInlineInstallFailure(install_id_, error); | 432 delegate_->OnInlineInstallFailure(install_id_, error); |
| 432 } | 433 } |
| 433 } | 434 } |
| 434 | 435 |
| 435 Release(); // Matches the AddRef in BeginInstall. | 436 Release(); // Matches the AddRef in BeginInstall. |
| 436 } | 437 } |
| OLD | NEW |