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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_SEARCH_ENGINES_TEMPLATE_URL_FETCHER_UI_CALLBACKS_H_
6 #define CHROME_BROWSER_UI_SEARCH_ENGINES_TEMPLATE_URL_FETCHER_UI_CALLBACKS_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "chrome/browser/search_engines/template_url_fetcher_callbacks.h"
11 #include "content/public/browser/notification_observer.h"
12 #include "content/public/browser/notification_registrar.h"
14 class SearchEngineTabHelper
;
20 // Callbacks which display UI for the TemplateURLFetcher.
21 class TemplateURLFetcherUICallbacks
: public TemplateURLFetcherCallbacks
,
22 public content::NotificationObserver
{
24 TemplateURLFetcherUICallbacks(SearchEngineTabHelper
* tab_helper
,
25 content::WebContents
* web_contents
);
26 virtual ~TemplateURLFetcherUICallbacks();
28 // TemplateURLFetcherCallback implementation.
29 virtual void ConfirmAddSearchProvider(TemplateURL
* template_url
,
30 Profile
* profile
) OVERRIDE
;
32 // content::NotificationObserver:
33 virtual void Observe(int type
,
34 const content::NotificationSource
& source
,
35 const content::NotificationDetails
& details
) OVERRIDE
;
38 // The SearchEngineTabHelper where this request originated. Can be NULL if the
39 // originating tab is closed. If NULL, the engine is not added.
40 SearchEngineTabHelper
* source_
;
42 // The WebContents where this request originated.
43 content::WebContents
* web_contents_
;
45 // Handles registering for our notifications.
46 content::NotificationRegistrar registrar_
;
48 DISALLOW_COPY_AND_ASSIGN(TemplateURLFetcherUICallbacks
);
51 #endif // CHROME_BROWSER_UI_SEARCH_ENGINES_TEMPLATE_URL_FETCHER_UI_CALLBACKS_H_