| Index: chrome/browser/extensions/webstore_inline_installer.cc
|
| diff --git a/chrome/browser/extensions/webstore_inline_installer.cc b/chrome/browser/extensions/webstore_inline_installer.cc
|
| index eb76482f7601f286c78ba00625f610055957a9a5..4a5642010b8956cd40a21a3b92b4fac5a89a200d 100644
|
| --- a/chrome/browser/extensions/webstore_inline_installer.cc
|
| +++ b/chrome/browser/extensions/webstore_inline_installer.cc
|
| @@ -157,9 +157,7 @@ WebstoreInlineInstaller::WebstoreInlineInstaller(WebContents* web_contents,
|
| requestor_url_(requestor_url),
|
| delegate_(delegate),
|
| average_rating_(0.0),
|
| - rating_count_(0) {}
|
| -
|
| -WebstoreInlineInstaller::~WebstoreInlineInstaller() {
|
| + rating_count_(0) {
|
| }
|
|
|
| void WebstoreInlineInstaller::BeginInstall() {
|
| @@ -188,6 +186,8 @@ void WebstoreInlineInstaller::BeginInstall() {
|
| webstore_data_url_fetcher_->Start();
|
| }
|
|
|
| +WebstoreInlineInstaller::~WebstoreInlineInstaller() {}
|
| +
|
| void WebstoreInlineInstaller::OnURLFetchComplete(
|
| const content::URLFetcher* source) {
|
| CHECK_EQ(webstore_data_url_fetcher_.get(), source);
|
| @@ -322,31 +322,6 @@ void WebstoreInlineInstaller::OnWebstoreResponseParseSuccess(
|
| helper->Start();
|
| }
|
|
|
| -// static
|
| -bool WebstoreInlineInstaller::IsRequestorURLInVerifiedSite(
|
| - const GURL& requestor_url,
|
| - const std::string& verified_site) {
|
| - // Turn the verified site (which may be a bare domain, or have a port and/or a
|
| - // path) into a URL that can be parsed by URLPattern.
|
| - std::string verified_site_url =
|
| - StringPrintf("http://*.%s%s",
|
| - verified_site.c_str(),
|
| - verified_site.find('/') == std::string::npos ? "/*" : "*");
|
| -
|
| - URLPattern verified_site_pattern(
|
| - URLPattern::SCHEME_HTTP | URLPattern::SCHEME_HTTPS);
|
| - URLPattern::ParseResult parse_result =
|
| - verified_site_pattern.Parse(verified_site_url);
|
| - if (parse_result != URLPattern::PARSE_SUCCESS) {
|
| - DLOG(WARNING) << "Could not parse " << verified_site_url <<
|
| - " as URL pattern " << parse_result;
|
| - return false;
|
| - }
|
| - verified_site_pattern.SetScheme("*");
|
| -
|
| - return verified_site_pattern.MatchesURL(requestor_url);
|
| -}
|
| -
|
| void WebstoreInlineInstaller::OnWebstoreResponseParseFailure(
|
| const std::string& error) {
|
| CompleteInstall(error);
|
| @@ -453,3 +428,28 @@ void WebstoreInlineInstaller::CompleteInstall(const std::string& error) {
|
|
|
| Release(); // Matches the AddRef in BeginInstall.
|
| }
|
| +
|
| +// static
|
| +bool WebstoreInlineInstaller::IsRequestorURLInVerifiedSite(
|
| + const GURL& requestor_url,
|
| + const std::string& verified_site) {
|
| + // Turn the verified site (which may be a bare domain, or have a port and/or a
|
| + // path) into a URL that can be parsed by URLPattern.
|
| + std::string verified_site_url =
|
| + StringPrintf("http://*.%s%s",
|
| + verified_site.c_str(),
|
| + verified_site.find('/') == std::string::npos ? "/*" : "*");
|
| +
|
| + URLPattern verified_site_pattern(
|
| + URLPattern::SCHEME_HTTP | URLPattern::SCHEME_HTTPS);
|
| + URLPattern::ParseResult parse_result =
|
| + verified_site_pattern.Parse(verified_site_url);
|
| + if (parse_result != URLPattern::PARSE_SUCCESS) {
|
| + DLOG(WARNING) << "Could not parse " << verified_site_url <<
|
| + " as URL pattern " << parse_result;
|
| + return false;
|
| + }
|
| + verified_site_pattern.SetScheme("*");
|
| +
|
| + return verified_site_pattern.MatchesURL(requestor_url);
|
| +}
|
|
|