OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_SETTINGS_SEARCH_ENGINES_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_SEARCH_ENGINES_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_SEARCH_ENGINES_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_SEARCH_ENGINES_HANDLER_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "chrome/browser/ui/search_engines/edit_search_engine_controller.h" | 11 #include "chrome/browser/ui/search_engines/edit_search_engine_controller.h" |
11 #include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h" | 12 #include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h" |
12 #include "ui/base/models/table_model_observer.h" | 13 #include "ui/base/models/table_model_observer.h" |
13 | 14 |
14 class KeywordEditorController; | 15 class KeywordEditorController; |
15 class Profile; | 16 class Profile; |
16 | 17 |
17 namespace extensions { | 18 namespace extensions { |
18 class Extension; | 19 class Extension; |
19 } | 20 } |
(...skipping 15 matching lines...) Expand all Loading... |
35 | 36 |
36 // EditSearchEngineControllerDelegate implementation. | 37 // EditSearchEngineControllerDelegate implementation. |
37 void OnEditedKeyword(TemplateURL* template_url, | 38 void OnEditedKeyword(TemplateURL* template_url, |
38 const base::string16& title, | 39 const base::string16& title, |
39 const base::string16& keyword, | 40 const base::string16& keyword, |
40 const std::string& url) override; | 41 const std::string& url) override; |
41 | 42 |
42 void RegisterMessages() override; | 43 void RegisterMessages() override; |
43 | 44 |
44 private: | 45 private: |
45 scoped_ptr<KeywordEditorController> list_controller_; | 46 std::unique_ptr<KeywordEditorController> list_controller_; |
46 scoped_ptr<EditSearchEngineController> edit_controller_; | 47 std::unique_ptr<EditSearchEngineController> edit_controller_; |
47 | 48 |
48 // Retrieves all search engines and returns the to WebUI. | 49 // Retrieves all search engines and returns the to WebUI. |
49 void HandleGetSearchEnginesList(const base::ListValue* args); | 50 void HandleGetSearchEnginesList(const base::ListValue* args); |
50 | 51 |
51 scoped_ptr<base::DictionaryValue> GetSearchEnginesList(); | 52 std::unique_ptr<base::DictionaryValue> GetSearchEnginesList(); |
52 | 53 |
53 // Removes the search engine at the given index. Called from WebUI. | 54 // Removes the search engine at the given index. Called from WebUI. |
54 void HandleRemoveSearchEngine(const base::ListValue* args); | 55 void HandleRemoveSearchEngine(const base::ListValue* args); |
55 | 56 |
56 // Sets the search engine at the given index to be default. Called from WebUI. | 57 // Sets the search engine at the given index to be default. Called from WebUI. |
57 void HandleSetDefaultSearchEngine(const base::ListValue* args); | 58 void HandleSetDefaultSearchEngine(const base::ListValue* args); |
58 | 59 |
59 // Starts an edit session for the search engine at the given index. If the | 60 // Starts an edit session for the search engine at the given index. If the |
60 // index is -1, starts editing a new search engine instead of an existing one. | 61 // index is -1, starts editing a new search engine instead of an existing one. |
61 // Called from WebUI. | 62 // Called from WebUI. |
(...skipping 27 matching lines...) Expand all Loading... |
89 const extensions::Extension& extension); | 90 const extensions::Extension& extension); |
90 | 91 |
91 Profile* const profile_; | 92 Profile* const profile_; |
92 | 93 |
93 DISALLOW_COPY_AND_ASSIGN(SearchEnginesHandler); | 94 DISALLOW_COPY_AND_ASSIGN(SearchEnginesHandler); |
94 }; | 95 }; |
95 | 96 |
96 } // namespace settings | 97 } // namespace settings |
97 | 98 |
98 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_SEARCH_ENGINES_HANDLER_H_ | 99 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_SEARCH_ENGINES_HANDLER_H_ |
OLD | NEW |