Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Side by Side Diff: chrome/browser/ui/search_engines/keyword_editor_controller.cc

Issue 2816383002: Remove non-const version of GetDefaultSearchProvider() and make all callers call the const version (Closed)
Patch Set: Fix unit test (the model was already loaded) Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/search_engines/keyword_editor_controller.h ('k') | components/omnibox/browser/history_url_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698