| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_SEARCH_ENGINES_KEYWORD_EDITOR_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_SEARCH_ENGINES_KEYWORD_EDITOR_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_SEARCH_ENGINES_KEYWORD_EDITOR_CONTROLLER_H_ | 6 #define CHROME_BROWSER_SEARCH_ENGINES_KEYWORD_EDITOR_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
| 12 | 12 |
| 13 class PrefService; |
| 13 class Profile; | 14 class Profile; |
| 14 class TemplateURL; | 15 class TemplateURL; |
| 15 class TemplateURLModel; | 16 class TemplateURLModel; |
| 16 class TemplateURLTableModel; | 17 class TemplateURLTableModel; |
| 17 | 18 |
| 18 class KeywordEditorController { | 19 class KeywordEditorController { |
| 19 public: | 20 public: |
| 20 explicit KeywordEditorController(Profile* profile); | 21 explicit KeywordEditorController(Profile* profile); |
| 21 ~KeywordEditorController(); | 22 ~KeywordEditorController(); |
| 22 | 23 |
| 24 static void RegisterPrefs(PrefService* prefs); |
| 25 |
| 23 // Invoked when the user succesfully fills out the add keyword dialog. | 26 // Invoked when the user succesfully fills out the add keyword dialog. |
| 24 // Propagates the change to the TemplateURLModel and updates the table model. | 27 // Propagates the change to the TemplateURLModel and updates the table model. |
| 25 // Returns the index of the added URL. | 28 // Returns the index of the added URL. |
| 26 int AddTemplateURL(const std::wstring& title, | 29 int AddTemplateURL(const std::wstring& title, |
| 27 const std::wstring& keyword, | 30 const std::wstring& keyword, |
| 28 const std::wstring& url); | 31 const std::wstring& url); |
| 29 | 32 |
| 30 // Invoked when the user modifies a TemplateURL. Updates the TemplateURLModel | 33 // Invoked when the user modifies a TemplateURL. Updates the TemplateURLModel |
| 31 // and table model appropriately. | 34 // and table model appropriately. |
| 32 void ModifyTemplateURL(const TemplateURL* template_url, | 35 void ModifyTemplateURL(const TemplateURL* template_url, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 63 // The profile. | 66 // The profile. |
| 64 Profile* profile_; | 67 Profile* profile_; |
| 65 | 68 |
| 66 // Model for the TableView. | 69 // Model for the TableView. |
| 67 scoped_ptr<TemplateURLTableModel> table_model_; | 70 scoped_ptr<TemplateURLTableModel> table_model_; |
| 68 | 71 |
| 69 DISALLOW_COPY_AND_ASSIGN(KeywordEditorController); | 72 DISALLOW_COPY_AND_ASSIGN(KeywordEditorController); |
| 70 }; | 73 }; |
| 71 | 74 |
| 72 #endif // CHROME_BROWSER_SEARCH_ENGINES_KEYWORD_EDITOR_CONTROLLER_H_ | 75 #endif // CHROME_BROWSER_SEARCH_ENGINES_KEYWORD_EDITOR_CONTROLLER_H_ |
| OLD | NEW |