| 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_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 Extension; | 12 class Extension; |
| 13 class KeywordEditorController; | 13 class KeywordEditorController; |
| 14 | 14 |
| 15 class SearchEngineManagerHandler : public OptionsPageUIHandler, | 15 class SearchEngineManagerHandler : public OptionsPageUIHandler, |
| 16 public ui::TableModelObserver, | 16 public ui::TableModelObserver, |
| 17 public EditSearchEngineControllerDelegate { | 17 public EditSearchEngineControllerDelegate { |
| 18 public: | 18 public: |
| 19 SearchEngineManagerHandler(); | 19 SearchEngineManagerHandler(); |
| 20 virtual ~SearchEngineManagerHandler(); | 20 virtual ~SearchEngineManagerHandler(); |
| 21 | 21 |
| 22 virtual void Initialize(); | 22 virtual void Initialize() OVERRIDE; |
| 23 | 23 |
| 24 // OptionsPageUIHandler implementation. | 24 // OptionsPageUIHandler implementation. |
| 25 virtual void GetLocalizedValues(base::DictionaryValue* localized_strings); | 25 virtual void GetLocalizedValues( |
| 26 base::DictionaryValue* localized_strings) OVERRIDE; |
| 26 | 27 |
| 27 // ui::TableModelObserver implementation. | 28 // ui::TableModelObserver implementation. |
| 28 virtual void OnModelChanged(); | 29 virtual void OnModelChanged() OVERRIDE; |
| 29 virtual void OnItemsChanged(int start, int length); | 30 virtual void OnItemsChanged(int start, int length) OVERRIDE; |
| 30 virtual void OnItemsAdded(int start, int length); | 31 virtual void OnItemsAdded(int start, int length) OVERRIDE; |
| 31 virtual void OnItemsRemoved(int start, int length); | 32 virtual void OnItemsRemoved(int start, int length) OVERRIDE; |
| 32 | 33 |
| 33 // EditSearchEngineControllerDelegate implementation. | 34 // EditSearchEngineControllerDelegate implementation. |
| 34 virtual void OnEditedKeyword(const TemplateURL* template_url, | 35 virtual void OnEditedKeyword(const TemplateURL* template_url, |
| 35 const string16& title, | 36 const string16& title, |
| 36 const string16& keyword, | 37 const string16& keyword, |
| 37 const std::string& url); | 38 const std::string& url) OVERRIDE; |
| 38 | 39 |
| 39 virtual void RegisterMessages(); | 40 virtual void RegisterMessages() OVERRIDE; |
| 40 | 41 |
| 41 private: | 42 private: |
| 42 scoped_ptr<KeywordEditorController> list_controller_; | 43 scoped_ptr<KeywordEditorController> list_controller_; |
| 43 scoped_ptr<EditSearchEngineController> edit_controller_; | 44 scoped_ptr<EditSearchEngineController> edit_controller_; |
| 44 | 45 |
| 45 // Removes the search engine at the given index. Called from WebUI. | 46 // Removes the search engine at the given index. Called from WebUI. |
| 46 void RemoveSearchEngine(const base::ListValue* args); | 47 void RemoveSearchEngine(const base::ListValue* args); |
| 47 | 48 |
| 48 // Sets the search engine at the given index to be default. Called from WebUI. | 49 // Sets the search engine at the given index to be default. Called from WebUI. |
| 49 void SetDefaultSearchEngine(const base::ListValue* args); | 50 void SetDefaultSearchEngine(const base::ListValue* args); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 69 base::DictionaryValue* CreateDictionaryForEngine(int index, bool is_default); | 70 base::DictionaryValue* CreateDictionaryForEngine(int index, bool is_default); |
| 70 | 71 |
| 71 // Returns a dictionary to pass to WebUI representing the extension. | 72 // Returns a dictionary to pass to WebUI representing the extension. |
| 72 base::DictionaryValue* CreateDictionaryForExtension( | 73 base::DictionaryValue* CreateDictionaryForExtension( |
| 73 const Extension& extension); | 74 const Extension& extension); |
| 74 | 75 |
| 75 DISALLOW_COPY_AND_ASSIGN(SearchEngineManagerHandler); | 76 DISALLOW_COPY_AND_ASSIGN(SearchEngineManagerHandler); |
| 76 }; | 77 }; |
| 77 | 78 |
| 78 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_SEARCH_ENGINE_MANAGER_HANDLER_H_ | 79 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_SEARCH_ENGINE_MANAGER_HANDLER_H_ |
| OLD | NEW |