summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgwilson@google.com <gwilson@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-15 16:04:45 +0000
committergwilson@google.com <gwilson@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-15 16:04:45 +0000
commit2debebb36a729b75fc6f6d3face461f52e822569 (patch)
tree023c7413c2939054c8baa34ae68399df60eb5229
parent351c523ffc1268331b7e26fc484e51ab829907c1 (diff)
downloadchromium_src-2debebb36a729b75fc6f6d3face461f52e822569.zip
chromium_src-2debebb36a729b75fc6f6d3face461f52e822569.tar.gz
chromium_src-2debebb36a729b75fc6f6d3face461f52e822569.tar.bz2
Modifies the Firefox import behavior such that if we're in first run, the importer is headless, and we're only importing the home page, skip the Firefox lock.
Otherwise, the process would silently wait for Firefox to close with no warnings. BUG=18709 TEST=set "import_home_page" : true, "skip_first_run_ui" : true in the master_preferences, and run without FirstRun. Import should not block. Review URL: http://codereview.chromium.org/174057 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26221 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/importer/importer.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/chrome/browser/importer/importer.cc b/chrome/browser/importer/importer.cc
index d1c8a13..7e3ad0f 100644
--- a/chrome/browser/importer/importer.cc
+++ b/chrome/browser/importer/importer.cc
@@ -547,6 +547,15 @@ void ImporterHost::StartImportSettings(const ProfileInfo& profile_info,
if (!firefox_lock_->HasAcquired()) {
// If fail to acquire the lock, we set the source unreadable and
// show a warning dialog.
+ // However, if we're running without a UI (silently) and trying to
+ // import just the home page, then import anyway. The home page setting
+ // is stored in an unlocked text file, so it is the only preference safe
+ // to import even if Firefox is running.
+ if (items == HOME_PAGE && first_run && this->headless_) {
+ AddRef();
+ InvokeTaskIfDone();
+ return;
+ }
is_source_readable_ = false;
ShowWarningDialog();
}