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

Unified Diff: chrome/browser/importer/firefox_importer_utils.cc

Issue 4281: Fixes bug in importer where we could set the default search provider... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/importer/importer.cc » ('j') | chrome/browser/importer/importer.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/importer/firefox_importer_utils.cc
===================================================================
--- chrome/browser/importer/firefox_importer_utils.cc (revision 2588)
+++ chrome/browser/importer/firefox_importer_utils.cc (working copy)
@@ -328,6 +328,14 @@
std::wstring default_se_name = UTF8ToWide(
ReadPrefsJsValue(profile_path, "browser.search.selectedEngine"));
+ if (default_se_name.empty()) {
+ // browser.search.selectedEngine does not exist if the user has not changed
+ // from the default (or has selected the default).
+ // TODO: should fallback to 'browser.search.defaultengine' if selectedEngine
+ // is empty.
+ return -1;
+ }
+
int default_se_index = -1;
for (std::vector<TemplateURL*>::const_iterator iter = search_engines.begin();
iter != search_engines.end(); ++iter) {
« no previous file with comments | « no previous file | chrome/browser/importer/importer.cc » ('j') | chrome/browser/importer/importer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698