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/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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 id_(webstore_item_id), | 156 id_(webstore_item_id), |
157 requestor_url_(requestor_url), | 157 requestor_url_(requestor_url), |
158 delegate_(delegate), | 158 delegate_(delegate), |
159 average_rating_(0.0), | 159 average_rating_(0.0), |
160 rating_count_(0) { | 160 rating_count_(0) { |
161 } | 161 } |
162 | 162 |
163 void WebstoreInlineInstaller::BeginInstall() { | 163 void WebstoreInlineInstaller::BeginInstall() { |
164 AddRef(); // Balanced in CompleteInstall or WebContentsDestroyed. | 164 AddRef(); // Balanced in CompleteInstall or WebContentsDestroyed. |
165 | 165 |
166 if (!Extension::IdIsValid(id_)) { | 166 if (!extensions::Extension::IdIsValid(id_)) { |
167 CompleteInstall(kInvalidWebstoreItemId); | 167 CompleteInstall(kInvalidWebstoreItemId); |
168 return; | 168 return; |
169 } | 169 } |
170 | 170 |
171 GURL webstore_data_url(extension_urls::GetWebstoreItemJsonDataURL(id_)); | 171 GURL webstore_data_url(extension_urls::GetWebstoreItemJsonDataURL(id_)); |
172 | 172 |
173 webstore_data_url_fetcher_.reset(content::URLFetcher::Create( | 173 webstore_data_url_fetcher_.reset(content::URLFetcher::Create( |
174 webstore_data_url, content::URLFetcher::GET, this)); | 174 webstore_data_url, content::URLFetcher::GET, this)); |
175 Profile* profile = Profile::FromBrowserContext( | 175 Profile* profile = Profile::FromBrowserContext( |
176 web_contents()->GetBrowserContext()); | 176 web_contents()->GetBrowserContext()); |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 verified_site_pattern.Parse(verified_site_url); | 446 verified_site_pattern.Parse(verified_site_url); |
447 if (parse_result != URLPattern::PARSE_SUCCESS) { | 447 if (parse_result != URLPattern::PARSE_SUCCESS) { |
448 DLOG(WARNING) << "Could not parse " << verified_site_url << | 448 DLOG(WARNING) << "Could not parse " << verified_site_url << |
449 " as URL pattern " << parse_result; | 449 " as URL pattern " << parse_result; |
450 return false; | 450 return false; |
451 } | 451 } |
452 verified_site_pattern.SetScheme("*"); | 452 verified_site_pattern.SetScheme("*"); |
453 | 453 |
454 return verified_site_pattern.MatchesURL(requestor_url); | 454 return verified_site_pattern.MatchesURL(requestor_url); |
455 } | 455 } |
OLD | NEW |