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 #ifndef COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_FETCHER_H_ | 5 #ifndef COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_FETCHER_H_ |
6 #define COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_FETCHER_H_ | 6 #define COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_FETCHER_H_ |
7 | 7 |
8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 scoped_ptr<TemplateURL> template_url)> ConfirmAddSearchProviderCallback; | 33 scoped_ptr<TemplateURL> template_url)> ConfirmAddSearchProviderCallback; |
34 | 34 |
35 enum ProviderType { | 35 enum ProviderType { |
36 AUTODETECTED_PROVIDER, | 36 AUTODETECTED_PROVIDER, |
37 EXPLICIT_PROVIDER // Supplied by Javascript. | 37 EXPLICIT_PROVIDER // Supplied by Javascript. |
38 }; | 38 }; |
39 | 39 |
40 // Creates a TemplateURLFetcher. | 40 // Creates a TemplateURLFetcher. |
41 TemplateURLFetcher(TemplateURLService* template_url_service, | 41 TemplateURLFetcher(TemplateURLService* template_url_service, |
42 net::URLRequestContextGetter* request_context); | 42 net::URLRequestContextGetter* request_context); |
43 virtual ~TemplateURLFetcher(); | 43 ~TemplateURLFetcher() override; |
44 | 44 |
45 // If TemplateURLFetcher is not already downloading the OSDD for osdd_url, | 45 // If TemplateURLFetcher is not already downloading the OSDD for osdd_url, |
46 // it is downloaded. If successful and the result can be parsed, a TemplateURL | 46 // it is downloaded. If successful and the result can be parsed, a TemplateURL |
47 // is added to the TemplateURLService. | 47 // is added to the TemplateURLService. |
48 // | 48 // |
49 // If |provider_type| is AUTODETECTED_PROVIDER, |keyword| must be non-empty, | 49 // If |provider_type| is AUTODETECTED_PROVIDER, |keyword| must be non-empty, |
50 // and if there's already a non-replaceable TemplateURL in the model for | 50 // and if there's already a non-replaceable TemplateURL in the model for |
51 // |keyword|, or we're already downloading an OSDD for this keyword, no | 51 // |keyword|, or we're already downloading an OSDD for this keyword, no |
52 // download is started. If |provider_type| is EXPLICIT_PROVIDER, |keyword| is | 52 // download is started. If |provider_type| is EXPLICIT_PROVIDER, |keyword| is |
53 // ignored. | 53 // ignored. |
(...skipping 26 matching lines...) Expand all Loading... |
80 TemplateURLService* template_url_service_; | 80 TemplateURLService* template_url_service_; |
81 scoped_refptr<net::URLRequestContextGetter> request_context_; | 81 scoped_refptr<net::URLRequestContextGetter> request_context_; |
82 | 82 |
83 // In progress requests. | 83 // In progress requests. |
84 Requests requests_; | 84 Requests requests_; |
85 | 85 |
86 DISALLOW_COPY_AND_ASSIGN(TemplateURLFetcher); | 86 DISALLOW_COPY_AND_ASSIGN(TemplateURLFetcher); |
87 }; | 87 }; |
88 | 88 |
89 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_FETCHER_H_ | 89 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_FETCHER_H_ |
OLD | NEW |