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

Unified Diff: chrome/browser/first_run/first_run_win.cc

Issue 12463030: Do not do AutoImport on Windows since the import process is already ran earlier as part of ProcessM… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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
Index: chrome/browser/first_run/first_run_win.cc
diff --git a/chrome/browser/first_run/first_run_win.cc b/chrome/browser/first_run/first_run_win.cc
index c3242a2efe102ca8348f84bfb0682a6645fd646f..8c61e7a1df7d48878ad9fd80897332da9e56b697 100644
--- a/chrome/browser/first_run/first_run_win.cc
+++ b/chrome/browser/first_run/first_run_win.cc
@@ -274,8 +274,7 @@ int ImportFromBrowser(Profile* profile,
}
#endif // !defined(USE_AURA)
-bool ImportSettingsWin(Profile* profile,
- int importer_type,
+bool ImportSettingsWin(int importer_type,
int items_to_import,
const base::FilePath& import_bookmarks_path,
bool skip_first_run_ui) {
@@ -333,11 +332,6 @@ bool ImportSettingsWin(Profile* profile,
// importer process ends.
ImportProcessRunner import_runner(import_process);
- // Import process finished. Reload the prefs, because importer may set
- // the pref value.
- if (profile)
- profile->GetPrefs()->ReloadPersistentPrefs();
-
return (import_runner.exit_code() == content::RESULT_CODE_NORMAL_EXIT);
}
@@ -364,30 +358,11 @@ void DoPostImportPlatformSpecificTasks() {
}
}
-bool ImportSettings(Profile* profile,
- scoped_refptr<ImporterHost> importer_host,
- scoped_refptr<ImporterList> importer_list,
- int items_to_import) {
- return ImportSettingsWin(
- profile,
- importer_list->GetSourceProfileAt(0).importer_type,
- items_to_import,
- base::FilePath(),
- false);
-}
-
bool GetFirstRunSentinelFilePath(base::FilePath* path) {
return GetSentinelFilePath(chrome::kFirstRunSentinel, path);
}
-void SetImportPreferencesAndLaunchImport(
- MasterPrefs* out_prefs,
- installer::MasterPreferences* install_prefs) {
- std::string import_bookmarks_path;
- install_prefs->GetString(
- installer::master_preferences::kDistroImportBookmarksFromFilePref,
- &import_bookmarks_path);
-
+void SetImportPreferencesAndLaunchImport(MasterPrefs* out_prefs) {
if (!IsOrganicFirstRun()) {
// If search engines aren't explicitly imported, don't import.
if (!(out_prefs->do_import_items & importer::SEARCH_ENGINES)) {
@@ -403,18 +378,21 @@ void SetImportPreferencesAndLaunchImport(
}
}
- if (out_prefs->do_import_items || !import_bookmarks_path.empty()) {
+ if (out_prefs->do_import_items || !out_prefs->import_bookmarks_path.empty()) {
// There is something to import from the default browser. This launches
// the importer process and blocks until done or until it fails.
scoped_refptr<ImporterList> importer_list(new ImporterList(NULL));
importer_list->DetectSourceProfilesHack();
- if (!ImportSettingsWin(
- NULL, importer_list->GetSourceProfileAt(0).importer_type,
- out_prefs->do_import_items, base::FilePath::FromWStringHack(UTF8ToWide(
- import_bookmarks_path)), true)) {
+ internal::g_profile_import_exited_successfully = ImportSettingsWin(
+ importer_list->GetSourceProfileAt(0).importer_type,
+ out_prefs->do_import_items,
+ base::FilePath::FromWStringHack(UTF8ToWide(
+ out_prefs->import_bookmarks_path)),
+ true);
+ if (!internal::g_profile_import_exited_successfully)
LOG(WARNING) << "silent import failed";
- }
}
+ internal::g_did_perform_profile_import = true;
}
bool ShowPostInstallEULAIfNeeded(installer::MasterPreferences* install_prefs) {
« chrome/browser/first_run/first_run.cc ('K') | « chrome/browser/first_run/first_run_posix.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698