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 ~SearchEngineManagerHandler() override; |
26 | 26 |
27 // OptionsPageUIHandler implementation. | 27 // OptionsPageUIHandler implementation. |
28 virtual void GetLocalizedValues( | 28 void GetLocalizedValues(base::DictionaryValue* localized_strings) override; |
29 base::DictionaryValue* localized_strings) override; | 29 void InitializeHandler() override; |
30 virtual void InitializeHandler() override; | 30 void InitializePage() override; |
31 virtual void InitializePage() override; | |
32 | 31 |
33 // ui::TableModelObserver implementation. | 32 // ui::TableModelObserver implementation. |
34 virtual void OnModelChanged() override; | 33 void OnModelChanged() override; |
35 virtual void OnItemsChanged(int start, int length) override; | 34 void OnItemsChanged(int start, int length) override; |
36 virtual void OnItemsAdded(int start, int length) override; | 35 void OnItemsAdded(int start, int length) override; |
37 virtual void OnItemsRemoved(int start, int length) override; | 36 void OnItemsRemoved(int start, int length) override; |
38 | 37 |
39 // EditSearchEngineControllerDelegate implementation. | 38 // EditSearchEngineControllerDelegate implementation. |
40 virtual void OnEditedKeyword(TemplateURL* template_url, | 39 void OnEditedKeyword(TemplateURL* template_url, |
41 const base::string16& title, | 40 const base::string16& title, |
42 const base::string16& keyword, | 41 const base::string16& keyword, |
43 const std::string& url) override; | 42 const std::string& url) override; |
44 | 43 |
45 virtual void RegisterMessages() override; | 44 void RegisterMessages() override; |
46 | 45 |
47 private: | 46 private: |
48 scoped_ptr<KeywordEditorController> list_controller_; | 47 scoped_ptr<KeywordEditorController> list_controller_; |
49 scoped_ptr<EditSearchEngineController> edit_controller_; | 48 scoped_ptr<EditSearchEngineController> edit_controller_; |
50 | 49 |
51 // Removes the search engine at the given index. Called from WebUI. | 50 // Removes the search engine at the given index. Called from WebUI. |
52 void RemoveSearchEngine(const base::ListValue* args); | 51 void RemoveSearchEngine(const base::ListValue* args); |
53 | 52 |
54 // Sets the search engine at the given index to be default. Called from WebUI. | 53 // Sets the search engine at the given index to be default. Called from WebUI. |
55 void SetDefaultSearchEngine(const base::ListValue* args); | 54 void SetDefaultSearchEngine(const base::ListValue* args); |
(...skipping 22 matching lines...) Expand all Loading... |
78 // Returns a dictionary to pass to WebUI representing the extension. | 77 // Returns a dictionary to pass to WebUI representing the extension. |
79 base::DictionaryValue* CreateDictionaryForExtension( | 78 base::DictionaryValue* CreateDictionaryForExtension( |
80 const extensions::Extension& extension); | 79 const extensions::Extension& extension); |
81 | 80 |
82 DISALLOW_COPY_AND_ASSIGN(SearchEngineManagerHandler); | 81 DISALLOW_COPY_AND_ASSIGN(SearchEngineManagerHandler); |
83 }; | 82 }; |
84 | 83 |
85 } // namespace options | 84 } // namespace options |
86 | 85 |
87 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_SEARCH_ENGINE_MANAGER_HANDLER_H_ | 86 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_SEARCH_ENGINE_MANAGER_HANDLER_H_ |
OLD | NEW |