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_SEARCH_ENGINES_EDIT_SEARCH_ENGINE_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_SEARCH_ENGINES_EDIT_SEARCH_ENGINE_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_SEARCH_ENGINES_EDIT_SEARCH_ENGINE_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_SEARCH_ENGINES_EDIT_SEARCH_ENGINE_CONTROLLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 const std::string& url) = 0; | 27 const std::string& url) = 0; |
28 | 28 |
29 protected: | 29 protected: |
30 virtual ~EditSearchEngineControllerDelegate() {} | 30 virtual ~EditSearchEngineControllerDelegate() {} |
31 }; | 31 }; |
32 | 32 |
33 // EditSearchEngineController provides the core platform independent logic | 33 // EditSearchEngineController provides the core platform independent logic |
34 // for the Edit Search Engine dialog. | 34 // for the Edit Search Engine dialog. |
35 class EditSearchEngineController { | 35 class EditSearchEngineController { |
36 public: | 36 public: |
37 // An enum to match the AddSearchProvider UMA enum. Values should not be | |
38 // changed; new ones must be added at the bottom. | |
39 enum EditSearchEngineActions { | |
40 ADD_SEARCH_PROVIDER_CALLED = 0, | |
41 CONFIRMATION_DIALOG_SHOWN = 1, | |
42 CONFIRMATION_DIALOG_CONFIRMED = 2, | |
43 CONFIRMATION_DIALOG_CANCELLED = 3, | |
44 NUM_EDIT_SEARCH_ENGINE_ACTIONS | |
45 }; | |
46 | |
47 // The |template_url| and/or |edit_keyword_delegate| may be NULL. | 37 // The |template_url| and/or |edit_keyword_delegate| may be NULL. |
48 EditSearchEngineController( | 38 EditSearchEngineController( |
49 TemplateURL* template_url, | 39 TemplateURL* template_url, |
50 EditSearchEngineControllerDelegate* edit_keyword_delegate, | 40 EditSearchEngineControllerDelegate* edit_keyword_delegate, |
51 Profile* profile); | 41 Profile* profile); |
52 ~EditSearchEngineController() {} | 42 ~EditSearchEngineController() {} |
53 | 43 |
54 // Returns true if the value of |title_input| is a valid search engine name. | 44 // Returns true if the value of |title_input| is a valid search engine name. |
55 bool IsTitleValid(const base::string16& title_input) const; | 45 bool IsTitleValid(const base::string16& title_input) const; |
56 | 46 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 // success to add/modify the entry. May be NULL. | 82 // success to add/modify the entry. May be NULL. |
93 EditSearchEngineControllerDelegate* edit_keyword_delegate_; | 83 EditSearchEngineControllerDelegate* edit_keyword_delegate_; |
94 | 84 |
95 // Profile whose TemplateURLService we're modifying. | 85 // Profile whose TemplateURLService we're modifying. |
96 Profile* profile_; | 86 Profile* profile_; |
97 | 87 |
98 DISALLOW_COPY_AND_ASSIGN(EditSearchEngineController); | 88 DISALLOW_COPY_AND_ASSIGN(EditSearchEngineController); |
99 }; | 89 }; |
100 | 90 |
101 #endif // CHROME_BROWSER_UI_SEARCH_ENGINES_EDIT_SEARCH_ENGINE_CONTROLLER_H_ | 91 #endif // CHROME_BROWSER_UI_SEARCH_ENGINES_EDIT_SEARCH_ENGINE_CONTROLLER_H_ |
OLD | NEW |