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 | 7 |
8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
9 #include "base/string16.h" | 9 #include "base/string16.h" |
10 #include "components/browser_context_keyed_service/browser_context_keyed_service
.h" | 10 #include "components/browser_context_keyed_service/browser_context_keyed_service
.h" |
11 #include "ui/gfx/native_widget_types.h" | 11 #include "ui/gfx/native_widget_types.h" |
12 | 12 |
13 class GURL; | 13 class GURL; |
14 class Profile; | 14 class Profile; |
15 class TemplateURL; | 15 class TemplateURL; |
16 class TemplateURLFetcherCallbacks; | 16 class TemplateURLFetcherCallbacks; |
17 | 17 |
18 namespace content { | 18 namespace content { |
19 class WebContents; | 19 class WebContents; |
20 } | 20 } |
21 | 21 |
22 // TemplateURLFetcher is responsible for downloading OpenSearch description | 22 // TemplateURLFetcher is responsible for downloading OpenSearch description |
23 // documents, creating a TemplateURL from the OSDD, and adding the TemplateURL | 23 // documents, creating a TemplateURL from the OSDD, and adding the TemplateURL |
24 // to the TemplateURLService. Downloading is done in the background. | 24 // to the TemplateURLService. Downloading is done in the background. |
25 // | 25 // |
26 class TemplateURLFetcher : public ProfileKeyedService { | 26 class TemplateURLFetcher : public BrowserContextKeyedService { |
27 public: | 27 public: |
28 enum ProviderType { | 28 enum ProviderType { |
29 AUTODETECTED_PROVIDER, | 29 AUTODETECTED_PROVIDER, |
30 EXPLICIT_PROVIDER // Supplied by Javascript. | 30 EXPLICIT_PROVIDER // Supplied by Javascript. |
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 virtual ~TemplateURLFetcher(); | 35 virtual ~TemplateURLFetcher(); |
36 | 36 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 71 |
72 Profile* profile_; | 72 Profile* profile_; |
73 | 73 |
74 // In progress requests. | 74 // In progress requests. |
75 Requests requests_; | 75 Requests requests_; |
76 | 76 |
77 DISALLOW_COPY_AND_ASSIGN(TemplateURLFetcher); | 77 DISALLOW_COPY_AND_ASSIGN(TemplateURLFetcher); |
78 }; | 78 }; |
79 | 79 |
80 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_FETCHER_H_ | 80 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_FETCHER_H_ |
OLD | NEW |