Index: chrome/browser/search_engines/template_url_fetcher.h |
diff --git a/chrome/browser/search_engines/template_url_fetcher.h b/chrome/browser/search_engines/template_url_fetcher.h |
index d85ec19bae2a1dd92f216a08f0ef15f01e4a8300..df66ba489966bf83578bff965e0bce20611e2b24 100644 |
--- a/chrome/browser/search_engines/template_url_fetcher.h |
+++ b/chrome/browser/search_engines/template_url_fetcher.h |
@@ -5,33 +5,42 @@ |
#ifndef CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_FETCHER_H_ |
#define CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_FETCHER_H_ |
+#include "base/callback_forward.h" |
+#include "base/memory/ref_counted.h" |
+#include "base/memory/scoped_ptr.h" |
#include "base/memory/scoped_vector.h" |
#include "base/strings/string16.h" |
#include "components/keyed_service/core/keyed_service.h" |
-#include "ui/gfx/native_widget_types.h" |
class GURL; |
-class Profile; |
class TemplateURL; |
-class TemplateURLFetcherCallbacks; |
+class TemplateURLService; |
namespace content { |
class WebContents; |
} |
+namespace net { |
+class URLRequestContextGetter; |
+} |
+ |
// TemplateURLFetcher is responsible for downloading OpenSearch description |
// documents, creating a TemplateURL from the OSDD, and adding the TemplateURL |
// to the TemplateURLService. Downloading is done in the background. |
// |
class TemplateURLFetcher : public KeyedService { |
public: |
+ typedef base::Callback<void( |
+ scoped_ptr<TemplateURL> template_url)> ConfirmAddSearchProviderCallback; |
+ |
enum ProviderType { |
AUTODETECTED_PROVIDER, |
EXPLICIT_PROVIDER // Supplied by Javascript. |
}; |
- // Creates a TemplateURLFetcher with the specified Profile. |
- explicit TemplateURLFetcher(Profile* profile); |
+ // Creates a TemplateURLFetcher. |
+ TemplateURLFetcher(TemplateURLService* template_url_service, |
+ net::URLRequestContextGetter* request_context); |
virtual ~TemplateURLFetcher(); |
// If TemplateURLFetcher is not already downloading the OSDD for osdd_url, |
@@ -50,7 +59,7 @@ class TemplateURLFetcher : public KeyedService { |
const GURL& osdd_url, |
const GURL& favicon_url, |
content::WebContents* web_contents, |
- TemplateURLFetcherCallbacks* callbacks, |
+ const ConfirmAddSearchProviderCallback& callback, |
ProviderType provider_type); |
// The current number of outstanding requests. |
@@ -64,12 +73,11 @@ class TemplateURLFetcher : public KeyedService { |
typedef ScopedVector<RequestDelegate> Requests; |
- Profile* profile() const { return profile_; } |
- |
// Invoked from the RequestDelegate when done downloading. |
void RequestCompleted(RequestDelegate* request); |
- Profile* profile_; |
+ TemplateURLService* template_url_service_; |
+ scoped_refptr<net::URLRequestContextGetter> request_context_; |
// In progress requests. |
Requests requests_; |