diff options
author | cpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-17 18:05:54 +0000 |
---|---|---|
committer | cpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-17 18:05:54 +0000 |
commit | 09da32d543461c90fcf3490966e0c4a670b9a2a8 (patch) | |
tree | 9503fe2d5a63b14bab3b5f00d6119770ec2a99d8 /chrome/browser/browser_main.cc | |
parent | 937bcde53a86ea06ac8379e882de339ed95e3897 (diff) | |
download | chromium_src-09da32d543461c90fcf3490966e0c4a670b9a2a8.zip chromium_src-09da32d543461c90fcf3490966e0c4a670b9a2a8.tar.gz chromium_src-09da32d543461c90fcf3490966e0c4a670b9a2a8.tar.bz2 |
Add processing for a master profile json file on first run. Allows:
- set home page / show home button
- show bookmarks bar
Review URL: http://codereview.chromium.org/7369
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3542 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_main.cc')
-rw-r--r-- | chrome/browser/browser_main.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index 6e819b2..5171c43 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -320,6 +320,7 @@ int BrowserMain(CommandLine &parsed_command_line, int show_command, bool is_first_run = FirstRun::IsChromeFirstRun() || parsed_command_line.HasSwitch(switches::kFirstRun); + bool first_run_ui_bypass = false; // Initialize ResourceBundle which handles files loaded from external // sources. This has to be done before uninstall code path and before prefs @@ -327,7 +328,7 @@ int BrowserMain(CommandLine &parsed_command_line, int show_command, local_state->RegisterStringPref(prefs::kApplicationLocale, L""); local_state->RegisterBooleanPref(prefs::kMetricsReportingEnabled, false); - // During first run we read the google update registry key to find what + // During first run we read the google_update registry key to find what // language the user selected when downloading the installer. This // becomes our default language in the prefs. if (is_first_run) { @@ -336,6 +337,12 @@ int BrowserMain(CommandLine &parsed_command_line, int show_command, local_state->SetString(prefs::kApplicationLocale, install_lang); if (GoogleUpdateSettings::GetCollectStatsConsent()) local_state->SetBoolean(prefs::kMetricsReportingEnabled, true); + // On first run, we need to process the master preferences before the + // browser's profile_manager object is created. + FirstRun::MasterPrefResult master_pref_res = + FirstRun::ProcessMasterPreferences(user_data_dir, std::wstring()); + first_run_ui_bypass = + (master_pref_res == FirstRun::MASTER_PROFILE_NO_FIRST_RUN_UI); } ResourceBundle::InitSharedInstance( @@ -351,7 +358,7 @@ int BrowserMain(CommandLine &parsed_command_line, int show_command, // Initialize histogram statistics gathering system. StatisticsRecorder statistics; - // Strart tracking the creation and deletion of Task instances + // Start tracking the creation and deletion of Task instances bool tracking_objects = false; #ifdef TRACK_ALL_TASK_OBJECTS tracking_objects = tracked_objects::ThreadData::StartTracking(true); @@ -453,7 +460,7 @@ int BrowserMain(CommandLine &parsed_command_line, int show_command, // Note that this be done _after_ the PrefService is initialized and all // preferences are registered, since some of the code that the importer // touches reads preferences. - if (is_first_run) { + if (is_first_run && !first_run_ui_bypass) { // We need to avoid dispatching new tabs when we are doing the import // because that will lead to data corruption or a crash. Lock() does that. message_window.Lock(); |