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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 webstore_data_url_fetcher_.reset(net::URLFetcher::Create( | 176 webstore_data_url_fetcher_.reset(net::URLFetcher::Create( |
177 webstore_data_url, net::URLFetcher::GET, this)); | 177 webstore_data_url, net::URLFetcher::GET, this)); |
178 Profile* profile = Profile::FromBrowserContext( | 178 Profile* profile = Profile::FromBrowserContext( |
179 web_contents()->GetBrowserContext()); | 179 web_contents()->GetBrowserContext()); |
180 webstore_data_url_fetcher_->SetRequestContext( | 180 webstore_data_url_fetcher_->SetRequestContext( |
181 profile->GetRequestContext()); | 181 profile->GetRequestContext()); |
182 // Use the requesting page as the referrer both since that is more correct | 182 // Use the requesting page as the referrer both since that is more correct |
183 // (it is the page that caused this request to happen) and so that we can | 183 // (it is the page that caused this request to happen) and so that we can |
184 // track top sites that trigger inline install requests. | 184 // track top sites that trigger inline install requests. |
185 webstore_data_url_fetcher_->SetReferrer(requestor_url_.spec()); | 185 webstore_data_url_fetcher_->SetReferrer(requestor_url_.spec()); |
186 webstore_data_url_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES | | 186 webstore_data_url_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES | |
187 net::LOAD_DO_NOT_SAVE_COOKIES | | |
188 net::LOAD_DISABLE_CACHE); | 187 net::LOAD_DISABLE_CACHE); |
189 webstore_data_url_fetcher_->Start(); | 188 webstore_data_url_fetcher_->Start(); |
190 } | 189 } |
191 | 190 |
192 WebstoreInlineInstaller::~WebstoreInlineInstaller() {} | 191 WebstoreInlineInstaller::~WebstoreInlineInstaller() {} |
193 | 192 |
194 void WebstoreInlineInstaller::OnURLFetchComplete( | 193 void WebstoreInlineInstaller::OnURLFetchComplete( |
195 const net::URLFetcher* source) { | 194 const net::URLFetcher* source) { |
196 CHECK_EQ(webstore_data_url_fetcher_.get(), source); | 195 CHECK_EQ(webstore_data_url_fetcher_.get(), source); |
197 // We shouldn't be getting UrlFetcher callbacks if the WebContents has gone | 196 // We shouldn't be getting UrlFetcher callbacks if the WebContents has gone |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 DLOG(WARNING) << "Could not parse " << verified_site_url << | 454 DLOG(WARNING) << "Could not parse " << verified_site_url << |
456 " as URL pattern " << parse_result; | 455 " as URL pattern " << parse_result; |
457 return false; | 456 return false; |
458 } | 457 } |
459 verified_site_pattern.SetScheme("*"); | 458 verified_site_pattern.SetScheme("*"); |
460 | 459 |
461 return verified_site_pattern.MatchesURL(requestor_url); | 460 return verified_site_pattern.MatchesURL(requestor_url); |
462 } | 461 } |
463 | 462 |
464 } // namespace extensions | 463 } // namespace extensions |
OLD | NEW |