| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "components/search_engines/template_url_fetcher.h" | 8 #include "components/search_engines/template_url_fetcher.h" |
| 9 | 9 |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 TemplateURLFetcher::RequestDelegate::RequestDelegate( | 65 TemplateURLFetcher::RequestDelegate::RequestDelegate( |
| 66 TemplateURLFetcher* fetcher, | 66 TemplateURLFetcher* fetcher, |
| 67 const base::string16& keyword, | 67 const base::string16& keyword, |
| 68 const GURL& osdd_url, | 68 const GURL& osdd_url, |
| 69 const GURL& favicon_url, | 69 const GURL& favicon_url, |
| 70 const URLFetcherCustomizeCallback& url_fetcher_customize_callback, | 70 const URLFetcherCustomizeCallback& url_fetcher_customize_callback, |
| 71 const ConfirmAddSearchProviderCallback& confirm_add_callback, | 71 const ConfirmAddSearchProviderCallback& confirm_add_callback, |
| 72 ProviderType provider_type) | 72 ProviderType provider_type) |
| 73 : url_fetcher_( | 73 : url_fetcher_( |
| 74 net::URLFetcher::Create(osdd_url, net::URLFetcher::GET, this).Pass()), | 74 net::URLFetcher::Create(osdd_url, net::URLFetcher::GET, this)), |
| 75 fetcher_(fetcher), | 75 fetcher_(fetcher), |
| 76 keyword_(keyword), | 76 keyword_(keyword), |
| 77 osdd_url_(osdd_url), | 77 osdd_url_(osdd_url), |
| 78 favicon_url_(favicon_url), | 78 favicon_url_(favicon_url), |
| 79 provider_type_(provider_type), | 79 provider_type_(provider_type), |
| 80 confirm_add_callback_(confirm_add_callback) { | 80 confirm_add_callback_(confirm_add_callback) { |
| 81 TemplateURLService* model = fetcher_->template_url_service_; | 81 TemplateURLService* model = fetcher_->template_url_service_; |
| 82 DCHECK(model); // TemplateURLFetcher::ScheduleDownload verifies this. | 82 DCHECK(model); // TemplateURLFetcher::ScheduleDownload verifies this. |
| 83 | 83 |
| 84 if (!model->loaded()) { | 84 if (!model->loaded()) { |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 confirm_add_callback, provider_type)); | 257 confirm_add_callback, provider_type)); |
| 258 } | 258 } |
| 259 | 259 |
| 260 void TemplateURLFetcher::RequestCompleted(RequestDelegate* request) { | 260 void TemplateURLFetcher::RequestCompleted(RequestDelegate* request) { |
| 261 Requests::iterator i = | 261 Requests::iterator i = |
| 262 std::find(requests_.begin(), requests_.end(), request); | 262 std::find(requests_.begin(), requests_.end(), request); |
| 263 DCHECK(i != requests_.end()); | 263 DCHECK(i != requests_.end()); |
| 264 requests_.weak_erase(i); | 264 requests_.weak_erase(i); |
| 265 delete request; | 265 delete request; |
| 266 } | 266 } |
| OLD | NEW |