| 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 #include "chrome/browser/ui/search_engines/keyword_editor_controller.h" | 5 #include "chrome/browser/ui/search_engines/keyword_editor_controller.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/prefs/pref_service.h" | 8 #include "chrome/browser/prefs/pref_service.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/search_engines/template_url.h" | 10 #include "chrome/browser/search_engines/template_url.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 table_model_.reset(new TemplateURLTableModel( | 21 table_model_.reset(new TemplateURLTableModel( |
| 22 TemplateURLServiceFactory::GetForProfile(profile))); | 22 TemplateURLServiceFactory::GetForProfile(profile))); |
| 23 } | 23 } |
| 24 | 24 |
| 25 KeywordEditorController::~KeywordEditorController() { | 25 KeywordEditorController::~KeywordEditorController() { |
| 26 } | 26 } |
| 27 | 27 |
| 28 // static | 28 // static |
| 29 // TODO(rsesek): Other platforms besides Mac should remember window | 29 // TODO(rsesek): Other platforms besides Mac should remember window |
| 30 // placement. http://crbug.com/22269 | 30 // placement. http://crbug.com/22269 |
| 31 void KeywordEditorController::RegisterPrefs(PrefService* prefs) { | 31 void KeywordEditorController::RegisterPrefs(PrefServiceSimple* prefs) { |
| 32 prefs->RegisterDictionaryPref(prefs::kKeywordEditorWindowPlacement); | 32 prefs->RegisterDictionaryPref(prefs::kKeywordEditorWindowPlacement); |
| 33 } | 33 } |
| 34 | 34 |
| 35 int KeywordEditorController::AddTemplateURL(const string16& title, | 35 int KeywordEditorController::AddTemplateURL(const string16& title, |
| 36 const string16& keyword, | 36 const string16& keyword, |
| 37 const std::string& url) { | 37 const std::string& url) { |
| 38 DCHECK(!url.empty()); | 38 DCHECK(!url.empty()); |
| 39 | 39 |
| 40 content::RecordAction(UserMetricsAction("KeywordEditor_AddKeyword")); | 40 content::RecordAction(UserMetricsAction("KeywordEditor_AddKeyword")); |
| 41 | 41 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 return url_model()->loaded(); | 98 return url_model()->loaded(); |
| 99 } | 99 } |
| 100 | 100 |
| 101 TemplateURL* KeywordEditorController::GetTemplateURL(int index) { | 101 TemplateURL* KeywordEditorController::GetTemplateURL(int index) { |
| 102 return table_model_->GetTemplateURL(index); | 102 return table_model_->GetTemplateURL(index); |
| 103 } | 103 } |
| 104 | 104 |
| 105 TemplateURLService* KeywordEditorController::url_model() const { | 105 TemplateURLService* KeywordEditorController::url_model() const { |
| 106 return table_model_->template_url_service(); | 106 return table_model_->template_url_service(); |
| 107 } | 107 } |
| OLD | NEW |