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_UI_WEBUI_OPTIONS_SEARCH_ENGINE_MANAGER_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_SEARCH_ENGINE_MANAGER_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_SEARCH_ENGINE_MANAGER_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_SEARCH_ENGINE_MANAGER_HANDLER_H_ |
7 | 7 |
8 #include "chrome/browser/ui/search_engines/edit_search_engine_controller.h" | 8 #include "chrome/browser/ui/search_engines/edit_search_engine_controller.h" |
9 #include "chrome/browser/ui/webui/options/options_ui.h" | 9 #include "chrome/browser/ui/webui/options/options_ui.h" |
10 #include "ui/base/models/table_model_observer.h" | 10 #include "ui/base/models/table_model_observer.h" |
11 | 11 |
12 class KeywordEditorController; | 12 class KeywordEditorController; |
13 | 13 |
14 namespace extensions { | 14 namespace extensions { |
15 class Extension; | 15 class Extension; |
16 } | 16 } |
17 | 17 |
18 namespace options { | 18 namespace options { |
19 | 19 |
20 class SearchEngineManagerHandler : public OptionsPageUIHandler, | 20 class SearchEngineManagerHandler : public OptionsPageUIHandler, |
21 public ui::TableModelObserver, | 21 public ui::TableModelObserver, |
22 public EditSearchEngineControllerDelegate { | 22 public EditSearchEngineControllerDelegate { |
23 public: | 23 public: |
24 SearchEngineManagerHandler(); | 24 SearchEngineManagerHandler(); |
25 virtual ~SearchEngineManagerHandler(); | 25 virtual ~SearchEngineManagerHandler(); |
26 | 26 |
27 // OptionsPageUIHandler implementation. | 27 // OptionsPageUIHandler implementation. |
28 virtual void GetLocalizedValues( | 28 virtual void GetLocalizedValues( |
29 base::DictionaryValue* localized_strings) OVERRIDE; | 29 base::DictionaryValue* localized_strings) override; |
30 virtual void InitializeHandler() OVERRIDE; | 30 virtual void InitializeHandler() override; |
31 virtual void InitializePage() OVERRIDE; | 31 virtual void InitializePage() override; |
32 | 32 |
33 // ui::TableModelObserver implementation. | 33 // ui::TableModelObserver implementation. |
34 virtual void OnModelChanged() OVERRIDE; | 34 virtual void OnModelChanged() override; |
35 virtual void OnItemsChanged(int start, int length) OVERRIDE; | 35 virtual void OnItemsChanged(int start, int length) override; |
36 virtual void OnItemsAdded(int start, int length) OVERRIDE; | 36 virtual void OnItemsAdded(int start, int length) override; |
37 virtual void OnItemsRemoved(int start, int length) OVERRIDE; | 37 virtual void OnItemsRemoved(int start, int length) override; |
38 | 38 |
39 // EditSearchEngineControllerDelegate implementation. | 39 // EditSearchEngineControllerDelegate implementation. |
40 virtual void OnEditedKeyword(TemplateURL* template_url, | 40 virtual void OnEditedKeyword(TemplateURL* template_url, |
41 const base::string16& title, | 41 const base::string16& title, |
42 const base::string16& keyword, | 42 const base::string16& keyword, |
43 const std::string& url) OVERRIDE; | 43 const std::string& url) override; |
44 | 44 |
45 virtual void RegisterMessages() OVERRIDE; | 45 virtual void RegisterMessages() override; |
46 | 46 |
47 private: | 47 private: |
48 scoped_ptr<KeywordEditorController> list_controller_; | 48 scoped_ptr<KeywordEditorController> list_controller_; |
49 scoped_ptr<EditSearchEngineController> edit_controller_; | 49 scoped_ptr<EditSearchEngineController> edit_controller_; |
50 | 50 |
51 // Removes the search engine at the given index. Called from WebUI. | 51 // Removes the search engine at the given index. Called from WebUI. |
52 void RemoveSearchEngine(const base::ListValue* args); | 52 void RemoveSearchEngine(const base::ListValue* args); |
53 | 53 |
54 // Sets the search engine at the given index to be default. Called from WebUI. | 54 // Sets the search engine at the given index to be default. Called from WebUI. |
55 void SetDefaultSearchEngine(const base::ListValue* args); | 55 void SetDefaultSearchEngine(const base::ListValue* args); |
(...skipping 22 matching lines...) Expand all Loading... |
78 // Returns a dictionary to pass to WebUI representing the extension. | 78 // Returns a dictionary to pass to WebUI representing the extension. |
79 base::DictionaryValue* CreateDictionaryForExtension( | 79 base::DictionaryValue* CreateDictionaryForExtension( |
80 const extensions::Extension& extension); | 80 const extensions::Extension& extension); |
81 | 81 |
82 DISALLOW_COPY_AND_ASSIGN(SearchEngineManagerHandler); | 82 DISALLOW_COPY_AND_ASSIGN(SearchEngineManagerHandler); |
83 }; | 83 }; |
84 | 84 |
85 } // namespace options | 85 } // namespace options |
86 | 86 |
87 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_SEARCH_ENGINE_MANAGER_HANDLER_H_ | 87 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_SEARCH_ENGINE_MANAGER_HANDLER_H_ |
OLD | NEW |