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/metrics/user_metrics.h" | 7 #include "base/metrics/user_metrics.h" |
8 #include "chrome/browser/search_engines/template_url_service_factory.h" | 8 #include "chrome/browser/search_engines/template_url_service_factory.h" |
9 #include "chrome/browser/ui/search_engines/template_url_table_model.h" | 9 #include "chrome/browser/ui/search_engines/template_url_table_model.h" |
10 #include "components/prefs/pref_registry_simple.h" | 10 #include "components/prefs/pref_registry_simple.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 bool KeywordEditorController::CanRemove(const TemplateURL* url) const { | 69 bool KeywordEditorController::CanRemove(const TemplateURL* url) const { |
70 return (url->type() == TemplateURL::NORMAL) && | 70 return (url->type() == TemplateURL::NORMAL) && |
71 (url != url_model_->GetDefaultSearchProvider()); | 71 (url != url_model_->GetDefaultSearchProvider()); |
72 } | 72 } |
73 | 73 |
74 void KeywordEditorController::RemoveTemplateURL(int index) { | 74 void KeywordEditorController::RemoveTemplateURL(int index) { |
75 table_model_->Remove(index); | 75 table_model_->Remove(index); |
76 base::RecordAction(UserMetricsAction("KeywordEditor_RemoveKeyword")); | 76 base::RecordAction(UserMetricsAction("KeywordEditor_RemoveKeyword")); |
77 } | 77 } |
78 | 78 |
79 TemplateURL* KeywordEditorController::GetDefaultSearchProvider() { | 79 const TemplateURL* KeywordEditorController::GetDefaultSearchProvider() { |
80 return url_model_->GetDefaultSearchProvider(); | 80 return url_model_->GetDefaultSearchProvider(); |
81 } | 81 } |
82 | 82 |
83 int KeywordEditorController::MakeDefaultTemplateURL(int index) { | 83 int KeywordEditorController::MakeDefaultTemplateURL(int index) { |
84 return table_model_->MakeDefaultTemplateURL(index); | 84 return table_model_->MakeDefaultTemplateURL(index); |
85 } | 85 } |
86 | 86 |
87 bool KeywordEditorController::loaded() const { | 87 bool KeywordEditorController::loaded() const { |
88 return url_model_->loaded(); | 88 return url_model_->loaded(); |
89 } | 89 } |
90 | 90 |
91 TemplateURL* KeywordEditorController::GetTemplateURL(int index) { | 91 TemplateURL* KeywordEditorController::GetTemplateURL(int index) { |
92 return table_model_->GetTemplateURL(index); | 92 return table_model_->GetTemplateURL(index); |
93 } | 93 } |
OLD | NEW |