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 #ifndef CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_FETCHER_H_ | 5 #ifndef CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_FETCHER_H_ |
6 #define CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_FETCHER_H_ | 6 #define CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_FETCHER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 }; | 31 }; |
32 | 32 |
33 // Creates a TemplateURLFetcher with the specified Profile. | 33 // Creates a TemplateURLFetcher with the specified Profile. |
34 explicit TemplateURLFetcher(Profile* profile); | 34 explicit TemplateURLFetcher(Profile* profile); |
35 ~TemplateURLFetcher(); | 35 ~TemplateURLFetcher(); |
36 | 36 |
37 // If TemplateURLFetcher is not already downloading the OSDD for osdd_url, | 37 // If TemplateURLFetcher is not already downloading the OSDD for osdd_url, |
38 // it is downloaded. If successful and the result can be parsed, a TemplateURL | 38 // it is downloaded. If successful and the result can be parsed, a TemplateURL |
39 // is added to the TemplateURLService. Takes ownership of |callbacks|. | 39 // is added to the TemplateURLService. Takes ownership of |callbacks|. |
40 // | 40 // |
| 41 // If |provider_type| is AUTODETECTED_PROVIDER, |keyword| must be non-empty, |
| 42 // and if there's already a non-replaceable TemplateURL in the model for |
| 43 // |keyword|, or we're already downloading an OSDD for this keyword, no |
| 44 // download is started. If |provider_type| is EXPLICIT_PROVIDER, |keyword| is |
| 45 // ignored. |
| 46 // |
41 // |web_contents| specifies which WebContents displays the page the OSDD is | 47 // |web_contents| specifies which WebContents displays the page the OSDD is |
42 // downloaded for. |web_contents| must not be NULL, except during tests. | 48 // downloaded for. |web_contents| must not be NULL, except during tests. |
43 void ScheduleDownload(const string16& keyword, | 49 void ScheduleDownload(const string16& keyword, |
44 const GURL& osdd_url, | 50 const GURL& osdd_url, |
45 const GURL& favicon_url, | 51 const GURL& favicon_url, |
46 content::WebContents* web_contents, | 52 content::WebContents* web_contents, |
47 TemplateURLFetcherCallbacks* callbacks, | 53 TemplateURLFetcherCallbacks* callbacks, |
48 ProviderType provider_type); | 54 ProviderType provider_type); |
49 | 55 |
50 // The current number of outstanding requests. | 56 // The current number of outstanding requests. |
(...skipping 14 matching lines...) Expand all Loading... |
65 | 71 |
66 Profile* profile_; | 72 Profile* profile_; |
67 | 73 |
68 // In progress requests. | 74 // In progress requests. |
69 Requests requests_; | 75 Requests requests_; |
70 | 76 |
71 DISALLOW_COPY_AND_ASSIGN(TemplateURLFetcher); | 77 DISALLOW_COPY_AND_ASSIGN(TemplateURLFetcher); |
72 }; | 78 }; |
73 | 79 |
74 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_FETCHER_H_ | 80 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_FETCHER_H_ |
OLD | NEW |