OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_UI_SEARCH_ENGINES_TEMPLATE_URL_FETCHER_UI_CALLBACKS_H_ | 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_ | 6 #define CHROME_BROWSER_UI_SEARCH_ENGINES_TEMPLATE_URL_FETCHER_UI_CALLBACKS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" |
10 #include "chrome/browser/search_engines/template_url_fetcher_callbacks.h" | 11 #include "chrome/browser/search_engines/template_url_fetcher_callbacks.h" |
11 #include "content/common/notification_observer.h" | 12 #include "content/common/notification_observer.h" |
12 #include "content/common/notification_registrar.h" | 13 #include "content/common/notification_registrar.h" |
13 | 14 |
14 class SearchEngineTabHelper; | 15 class SearchEngineTabHelper; |
15 class TabContents; | 16 class TabContents; |
16 | 17 |
17 // Callbacks which display UI for the TemplateURLFetcher. | 18 // Callbacks which display UI for the TemplateURLFetcher. |
18 class TemplateURLFetcherUICallbacks : public TemplateURLFetcherCallbacks, | 19 class TemplateURLFetcherUICallbacks : public TemplateURLFetcherCallbacks, |
19 public NotificationObserver { | 20 public NotificationObserver { |
20 public: | 21 public: |
21 TemplateURLFetcherUICallbacks(SearchEngineTabHelper* tab_helper, | 22 TemplateURLFetcherUICallbacks(SearchEngineTabHelper* tab_helper, |
22 TabContents* tab_contents); | 23 TabContents* tab_contents); |
23 virtual ~TemplateURLFetcherUICallbacks(); | 24 virtual ~TemplateURLFetcherUICallbacks(); |
24 | 25 |
25 // TemplateURLFetcherCallback implementation. | 26 // TemplateURLFetcherCallback implementation. |
26 virtual void ConfirmSetDefaultSearchProvider( | 27 virtual void ConfirmSetDefaultSearchProvider(TemplateURL* template_url, |
27 TemplateURL* template_url, | 28 Profile* profile) OVERRIDE; |
28 TemplateURLService* template_url_service); | 29 virtual void ConfirmAddSearchProvider(TemplateURL* template_url, |
29 virtual void ConfirmAddSearchProvider( | 30 Profile* profile) OVERRIDE; |
30 TemplateURL* template_url, | |
31 Profile* profile); | |
32 | 31 |
33 // NotificationObserver: | 32 // NotificationObserver: |
34 virtual void Observe(int type, | 33 virtual void Observe(int type, |
35 const NotificationSource& source, | 34 const NotificationSource& source, |
36 const NotificationDetails& details); | 35 const NotificationDetails& details) OVERRIDE; |
37 | 36 |
38 private: | 37 private: |
39 // The SearchEngineTabHelper where this request originated. Can be NULL if the | 38 // The SearchEngineTabHelper where this request originated. Can be NULL if the |
40 // originating tab is closed. If NULL, the engine is not added. | 39 // originating tab is closed. If NULL, the engine is not added. |
41 SearchEngineTabHelper* source_; | 40 SearchEngineTabHelper* source_; |
42 | 41 |
43 // The TabContents where this request originated. | 42 // The TabContents where this request originated. |
44 TabContents* tab_contents_; | 43 TabContents* tab_contents_; |
45 | 44 |
46 // Handles registering for our notifications. | 45 // Handles registering for our notifications. |
47 NotificationRegistrar registrar_; | 46 NotificationRegistrar registrar_; |
48 | 47 |
49 DISALLOW_COPY_AND_ASSIGN(TemplateURLFetcherUICallbacks); | 48 DISALLOW_COPY_AND_ASSIGN(TemplateURLFetcherUICallbacks); |
50 }; | 49 }; |
51 | 50 |
52 #endif // CHROME_BROWSER_UI_SEARCH_ENGINES_TEMPLATE_URL_FETCHER_UI_CALLBACKS_H_ | 51 #endif // CHROME_BROWSER_UI_SEARCH_ENGINES_TEMPLATE_URL_FETCHER_UI_CALLBACKS_H_ |
OLD | NEW |