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 "components/search_engines/template_url_fetcher.h" | 7 #include "components/search_engines/template_url_fetcher.h" |
8 | 8 |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 const base::string16& keyword, | 25 const base::string16& keyword, |
26 const GURL& osdd_url, | 26 const GURL& osdd_url, |
27 const GURL& favicon_url, | 27 const GURL& favicon_url, |
28 const URLFetcherCustomizeCallback& url_fetcher_customize_callback, | 28 const URLFetcherCustomizeCallback& url_fetcher_customize_callback, |
29 const ConfirmAddSearchProviderCallback& confirm_add_callback, | 29 const ConfirmAddSearchProviderCallback& confirm_add_callback, |
30 ProviderType provider_type); | 30 ProviderType provider_type); |
31 | 31 |
32 // net::URLFetcherDelegate: | 32 // net::URLFetcherDelegate: |
33 // If data contains a valid OSDD, a TemplateURL is created and added to | 33 // If data contains a valid OSDD, a TemplateURL is created and added to |
34 // the TemplateURLService. | 34 // the TemplateURLService. |
35 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; | 35 virtual void OnURLFetchComplete(const net::URLFetcher* source) override; |
36 | 36 |
37 // URL of the OSDD. | 37 // URL of the OSDD. |
38 GURL url() const { return osdd_url_; } | 38 GURL url() const { return osdd_url_; } |
39 | 39 |
40 // Keyword to use. | 40 // Keyword to use. |
41 base::string16 keyword() const { return keyword_; } | 41 base::string16 keyword() const { return keyword_; } |
42 | 42 |
43 // The type of search provider being fetched. | 43 // The type of search provider being fetched. |
44 ProviderType provider_type() const { return provider_type_; } | 44 ProviderType provider_type() const { return provider_type_; } |
45 | 45 |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 confirm_add_callback, provider_type)); | 256 confirm_add_callback, provider_type)); |
257 } | 257 } |
258 | 258 |
259 void TemplateURLFetcher::RequestCompleted(RequestDelegate* request) { | 259 void TemplateURLFetcher::RequestCompleted(RequestDelegate* request) { |
260 Requests::iterator i = | 260 Requests::iterator i = |
261 std::find(requests_.begin(), requests_.end(), request); | 261 std::find(requests_.begin(), requests_.end(), request); |
262 DCHECK(i != requests_.end()); | 262 DCHECK(i != requests_.end()); |
263 requests_.weak_erase(i); | 263 requests_.weak_erase(i); |
264 delete request; | 264 delete request; |
265 } | 265 } |
OLD | NEW |