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

Side by Side Diff: chrome/browser/chrome_browser_main.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chrome_browser_main.h" 5 #include "chrome/browser/chrome_browser_main.h"
6 6
7 #if defined(TOOLKIT_GTK) 7 #if defined(TOOLKIT_GTK)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after
961 if (!master_prefs_->variations_seed.empty()) { 961 if (!master_prefs_->variations_seed.empty()) {
962 local_state_->SetString(prefs::kVariationsSeed, 962 local_state_->SetString(prefs::kVariationsSeed,
963 master_prefs_->variations_seed); 963 master_prefs_->variations_seed);
964 // Set the variation seed date to the current system time. If the user's 964 // Set the variation seed date to the current system time. If the user's
965 // clock is incorrect, this may cause some field trial expiry checks to 965 // clock is incorrect, this may cause some field trial expiry checks to
966 // not do the right thing until the next seed update from the server, 966 // not do the right thing until the next seed update from the server,
967 // when this value will be updated. 967 // when this value will be updated.
968 local_state_->SetInt64(prefs::kVariationsSeedDate, 968 local_state_->SetInt64(prefs::kVariationsSeedDate,
969 base::Time::Now().ToInternalValue()); 969 base::Time::Now().ToInternalValue());
970 } 970 }
971 } else if (parsed_command_line().HasSwitch(switches::kNoFirstRun)) { 971 }
972 // Create the First Run beacon anyways if --no-first-run was passed on the 972
973 // command line. 973 if (do_first_run_tasks_ ||
974 parsed_command_line().HasSwitch(switches::kNoFirstRun)) {
975 // Create the First Run sentinel whether first run tasks are executed
976 // or not.
974 first_run::CreateSentinel(); 977 first_run::CreateSentinel();
975 } 978 }
976 } 979 }
977 #endif 980 #endif
978 981
979 // TODO(viettrungluu): why don't we run this earlier? 982 // TODO(viettrungluu): why don't we run this earlier?
980 if (!parsed_command_line().HasSwitch(switches::kNoErrorDialogs)) 983 if (!parsed_command_line().HasSwitch(switches::kNoErrorDialogs))
981 WarnAboutMinimumSystemRequirements(); 984 WarnAboutMinimumSystemRequirements();
982 985
983 #if defined(OS_LINUX) || defined(OS_OPENBSD) || defined(OS_MACOSX) 986 #if defined(OS_LINUX) || defined(OS_OPENBSD) || defined(OS_MACOSX)
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
1330 if (g_browser_process->gl_string_manager()) 1333 if (g_browser_process->gl_string_manager())
1331 g_browser_process->gl_string_manager()->Initialize(); 1334 g_browser_process->gl_string_manager()->Initialize();
1332 1335
1333 #if !defined(OS_ANDROID) 1336 #if !defined(OS_ANDROID)
1334 // Show the First Run UI if this is the first time Chrome has been run on 1337 // Show the First Run UI if this is the first time Chrome has been run on
1335 // this computer, or we're being compelled to do so by a command line flag. 1338 // this computer, or we're being compelled to do so by a command line flag.
1336 // Note that this be done _after_ the PrefService is initialized and all 1339 // Note that this be done _after_ the PrefService is initialized and all
1337 // preferences are registered, since some of the code that the importer 1340 // preferences are registered, since some of the code that the importer
1338 // touches reads preferences. 1341 // touches reads preferences.
1339 if (do_first_run_tasks_) { 1342 if (do_first_run_tasks_) {
1343 // On Windows the import process was already launched from
1344 // ProcessMasterPreferences()-->SetImportPreferencesAndLaunchImport()-->
1345 // ImportSettingsWin().
1346 // Windows should really use the OOP import (http://crbug.com/22142), but for
1347 // now let's at least not run the import twice on Windows. It has to run before
1348 // the profile is created because the import process is designed to interact
1349 // with the profile itself (and trying to import at this point causes issues
1350 // like http://crbug.com/180459 and http://crbug.com/171475).
Joao da Silva 2013/03/12 13:32:05 nit: indentation
gab 2013/03/25 16:00:43 On purpose since comment is for the #if !defined(O
1351 #if !defined(OS_WIN)
Joao da Silva 2013/03/12 13:32:05 If OS_WIN, can we CHECK that the import process ha
gab 2013/03/25 16:00:43 Good idea, done.
1340 first_run::AutoImport(profile_, 1352 first_run::AutoImport(profile_,
1341 master_prefs_->homepage_defined, 1353 master_prefs_->homepage_defined,
1342 master_prefs_->do_import_items, 1354 master_prefs_->do_import_items,
1343 master_prefs_->dont_import_items, 1355 master_prefs_->dont_import_items,
1344 process_singleton_.get()); 1356 process_singleton_.get());
1357 #endif
1345 // Note: this can pop the first run consent dialog on linux. 1358 // Note: this can pop the first run consent dialog on linux.
1346 first_run::DoPostImportTasks(profile_, master_prefs_->make_chrome_default); 1359 first_run::DoPostImportTasks(profile_, master_prefs_->make_chrome_default);
1347 1360
1348 browser_process_->profile_manager()->OnImportFinished(profile_); 1361 browser_process_->profile_manager()->OnImportFinished(profile_);
1349 1362
1350 if (!master_prefs_->suppress_first_run_default_browser_prompt) { 1363 if (!master_prefs_->suppress_first_run_default_browser_prompt) {
1351 browser_creator_->set_show_main_browser_window( 1364 browser_creator_->set_show_main_browser_window(
1352 !chrome::ShowFirstRunDefaultBrowserPrompt(profile_)); 1365 !chrome::ShowFirstRunDefaultBrowserPrompt(profile_));
1353 } else { 1366 } else {
1354 browser_creator_->set_is_default_browser_dialog_suppressed(true); 1367 browser_creator_->set_is_default_browser_dialog_suppressed(true);
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
1811 if (base::win::GetVersion() <= base::win::VERSION_XP) 1824 if (base::win::GetVersion() <= base::win::VERSION_XP)
1812 uma_name += "_XP"; 1825 uma_name += "_XP";
1813 1826
1814 uma_name += "_PreRead_"; 1827 uma_name += "_PreRead_";
1815 uma_name += pre_read_percentage; 1828 uma_name += pre_read_percentage;
1816 AddPreReadHistogramTime(uma_name.c_str(), time); 1829 AddPreReadHistogramTime(uma_name.c_str(), time);
1817 } 1830 }
1818 #endif 1831 #endif
1819 #endif 1832 #endif
1820 } 1833 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/first_run/first_run.h » ('j') | chrome/browser/first_run/first_run.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698