| 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #include "chrome/browser/search_engines/template_url_fetcher.h" | 7 #include "chrome/browser/search_engines/template_url_fetcher.h" |
| 8 | 8 |
| 9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 // expects feedback that his action did something. | 247 // expects feedback that his action did something. |
| 248 // The source TabContents' delegate takes care of adding the URL to the | 248 // The source TabContents' delegate takes care of adding the URL to the |
| 249 // model, which takes ownership, or of deleting it if the add is | 249 // model, which takes ownership, or of deleting it if the add is |
| 250 // cancelled. | 250 // cancelled. |
| 251 callbacks_->ConfirmAddSearchProvider(template_url_.release(), | 251 callbacks_->ConfirmAddSearchProvider(template_url_.release(), |
| 252 fetcher_->profile()); | 252 fetcher_->profile()); |
| 253 break; | 253 break; |
| 254 | 254 |
| 255 case EXPLICIT_DEFAULT_PROVIDER: | 255 case EXPLICIT_DEFAULT_PROVIDER: |
| 256 callbacks_->ConfirmSetDefaultSearchProvider(template_url_.release(), | 256 callbacks_->ConfirmSetDefaultSearchProvider(template_url_.release(), |
| 257 model); | 257 fetcher_->profile()); |
| 258 break; | 258 break; |
| 259 } | 259 } |
| 260 | 260 |
| 261 fetcher_->RequestCompleted(this); | 261 fetcher_->RequestCompleted(this); |
| 262 // WARNING: RequestCompleted deletes us. | 262 // WARNING: RequestCompleted deletes us. |
| 263 } | 263 } |
| 264 | 264 |
| 265 // TemplateURLFetcher --------------------------------------------------------- | 265 // TemplateURLFetcher --------------------------------------------------------- |
| 266 | 266 |
| 267 TemplateURLFetcher::TemplateURLFetcher(Profile* profile) : profile_(profile) { | 267 TemplateURLFetcher::TemplateURLFetcher(Profile* profile) : profile_(profile) { |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 new RequestDelegate(this, keyword, osdd_url, favicon_url, | 324 new RequestDelegate(this, keyword, osdd_url, favicon_url, |
| 325 owned_callbacks.release(), provider_type)); | 325 owned_callbacks.release(), provider_type)); |
| 326 } | 326 } |
| 327 | 327 |
| 328 void TemplateURLFetcher::RequestCompleted(RequestDelegate* request) { | 328 void TemplateURLFetcher::RequestCompleted(RequestDelegate* request) { |
| 329 DCHECK(find(requests_->begin(), requests_->end(), request) != | 329 DCHECK(find(requests_->begin(), requests_->end(), request) != |
| 330 requests_->end()); | 330 requests_->end()); |
| 331 requests_->erase(find(requests_->begin(), requests_->end(), request)); | 331 requests_->erase(find(requests_->begin(), requests_->end(), request)); |
| 332 delete request; | 332 delete request; |
| 333 } | 333 } |
| OLD | NEW |