summaryrefslogtreecommitdiffstats
path: root/chrome/browser/importer.cc
diff options
context:
space:
mode:
authorpkasting@google.com <pkasting@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-01 01:57:42 +0000
committerpkasting@google.com <pkasting@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-01 01:57:42 +0000
commitf0118db83aa396c97628c33a030627f72bdf0444 (patch)
treecfc3bf1eb149ab36f88077e27a2e2da1de69d593 /chrome/browser/importer.cc
parent53eaee80ee4556a8dc4e0ac5158a56fd236a70c9 (diff)
downloadchromium_src-f0118db83aa396c97628c33a030627f72bdf0444.zip
chromium_src-f0118db83aa396c97628c33a030627f72bdf0444.tar.gz
chromium_src-f0118db83aa396c97628c33a030627f72bdf0444.tar.bz2
Pick the most commonly used search engine as the default when we have competing can-be-default choices with the same host and path. Previously we would end up picking the least commonly used engine in this case.
BUG=1303406 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@218 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/importer.cc')
-rw-r--r--chrome/browser/importer.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/chrome/browser/importer.cc b/chrome/browser/importer.cc
index e25c03a..95e035e 100644
--- a/chrome/browser/importer.cc
+++ b/chrome/browser/importer.cc
@@ -188,10 +188,13 @@ static void BuildHostPathMap(const TemplateURLModel& model,
const std::string host_path = BuildHostPathKey(template_urls[i]);
if (!host_path.empty()) {
const TemplateURL* existing_turl = (*host_path_map)[host_path];
- if (!existing_turl || template_urls[i]->show_in_default_list()) {
+ if (!existing_turl ||
+ (template_urls[i]->show_in_default_list() &&
+ !existing_turl->show_in_default_list())) {
// If there are multiple TemplateURLs with the same host+path, favor
- // those show in the default list. This is done just in case we end
- // up using it as the default search provider.
+ // those shown in the default list. If there are multiple potential
+ // defaults, favor the first one, which should be the more commonly used
+ // one.
(*host_path_map)[host_path] = template_urls[i];
}
} // else case, TemplateURL doesn't have a search url, doesn't support