summaryrefslogtreecommitdiffstats
path: root/chrome/browser/search_engines/template_url_model.cc
diff options
context:
space:
mode:
authorlevin@chromium.org <levin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-11 22:58:20 +0000
committerlevin@chromium.org <levin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-11 22:58:20 +0000
commit2de7e004b9e0cede80a1955d99d01a1e484182d9 (patch)
treeb557dd9dec9b168190d96521c8e5d028f576b0b6 /chrome/browser/search_engines/template_url_model.cc
parent13287f25a7562744b3570c2bc6ab9f329f35e239 (diff)
downloadchromium_src-2de7e004b9e0cede80a1955d99d01a1e484182d9.zip
chromium_src-2de7e004b9e0cede80a1955d99d01a1e484182d9.tar.gz
chromium_src-2de7e004b9e0cede80a1955d99d01a1e484182d9.tar.bz2
Wire up InstallSearchProvider to allow setting the default search provider.
Depends on http://codereview.chromium.org/3673002/show. BUG=38475 TEST=Next patch changes the callback mechanism TemplateURLFetcher to make it much more testable and adds tests. (I kept it out of this one to make this more focused.) Review URL: http://codereview.chromium.org/3652003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62204 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/search_engines/template_url_model.cc')
-rw-r--r--chrome/browser/search_engines/template_url_model.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/chrome/browser/search_engines/template_url_model.cc b/chrome/browser/search_engines/template_url_model.cc
index 043633c..aa543fb 100644
--- a/chrome/browser/search_engines/template_url_model.cc
+++ b/chrome/browser/search_engines/template_url_model.cc
@@ -390,6 +390,13 @@ void TemplateURLModel::ResetTemplateURL(const TemplateURL* url,
NotifyObservers();
}
+bool TemplateURLModel::CanMakeDefault(const TemplateURL* url) {
+ return url != GetDefaultSearchProvider() &&
+ url->url() &&
+ url->url()->SupportsReplacement() &&
+ !is_default_search_managed();
+}
+
void TemplateURLModel::SetDefaultSearchProvider(const TemplateURL* url) {
if (is_default_search_managed_) {
NOTREACHED();