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

Side by Side Diff: trunk/src/chrome/browser/chrome_browser_main.cc

Issue 15968002: Revert 201837 "OOP import on Windows." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 7 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
« no previous file with comments | « no previous file | trunk/src/chrome/browser/extensions/extension_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 765 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 #if !defined(OS_ANDROID) 776 #if !defined(OS_ANDROID)
777 process_singleton_.reset(new ChromeProcessSingleton( 777 process_singleton_.reset(new ChromeProcessSingleton(
778 user_data_dir_, base::Bind(&ProcessSingletonNotificationCallback))); 778 user_data_dir_, base::Bind(&ProcessSingletonNotificationCallback)));
779 779
780 bool force_first_run = 780 bool force_first_run =
781 parsed_command_line().HasSwitch(switches::kForceFirstRun); 781 parsed_command_line().HasSwitch(switches::kForceFirstRun);
782 bool force_skip_first_run_tasks = 782 bool force_skip_first_run_tasks =
783 (!force_first_run && 783 (!force_first_run &&
784 parsed_command_line().HasSwitch(switches::kNoFirstRun)); 784 parsed_command_line().HasSwitch(switches::kNoFirstRun));
785 785
786 is_first_run = force_first_run || first_run::IsChromeFirstRun(); 786 is_first_run =
787 (force_first_run || first_run::IsChromeFirstRun()) &&
788 !ProfileManager::IsImportProcess(parsed_command_line());
787 #endif 789 #endif
788 790
789 scoped_refptr<base::SequencedTaskRunner> local_state_task_runner = 791 scoped_refptr<base::SequencedTaskRunner> local_state_task_runner =
790 JsonPrefStore::GetTaskRunnerForFile( 792 JsonPrefStore::GetTaskRunnerForFile(
791 base::FilePath(chrome::kLocalStorePoolName), 793 base::FilePath(chrome::kLocalStorePoolName),
792 BrowserThread::GetBlockingPool()); 794 BrowserThread::GetBlockingPool());
793 795
794 { 796 {
795 TRACE_EVENT0("startup", 797 TRACE_EVENT0("startup",
796 "ChromeBrowserMainParts::PreCreateThreadsImpl:InitBrowswerProcessImpl"); 798 "ChromeBrowserMainParts::PreCreateThreadsImpl:InitBrowswerProcessImpl");
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
1149 #if !defined(OS_ANDROID) 1151 #if !defined(OS_ANDROID)
1150 // If the command line specifies --pack-extension, attempt the pack extension 1152 // If the command line specifies --pack-extension, attempt the pack extension
1151 // startup action and exit. 1153 // startup action and exit.
1152 if (parsed_command_line().HasSwitch(switches::kPackExtension)) { 1154 if (parsed_command_line().HasSwitch(switches::kPackExtension)) {
1153 extensions::StartupHelper extension_startup_helper; 1155 extensions::StartupHelper extension_startup_helper;
1154 if (extension_startup_helper.PackExtension(parsed_command_line())) 1156 if (extension_startup_helper.PackExtension(parsed_command_line()))
1155 return content::RESULT_CODE_NORMAL_EXIT; 1157 return content::RESULT_CODE_NORMAL_EXIT;
1156 return chrome::RESULT_CODE_PACK_EXTENSION_ERROR; 1158 return chrome::RESULT_CODE_PACK_EXTENSION_ERROR;
1157 } 1159 }
1158 1160
1161 bool pass_command_line = true;
1162
1163 #if !defined(OS_MACOSX)
1164 // In environments other than Mac OS X we support import of settings
1165 // from other browsers. In case this process is a short-lived "import"
1166 // process that another browser runs just to import the settings, we
1167 // don't want to be checking for another browser process, by design.
1168 pass_command_line = !ProfileManager::IsImportProcess(parsed_command_line());
1169 #endif
1170
1159 // If we're being launched just to check the connector policy, we are 1171 // If we're being launched just to check the connector policy, we are
1160 // short-lived and don't want to be passing that switch off. 1172 // short-lived and don't want to be passing that switch off.
1161 bool pass_command_line = !parsed_command_line().HasSwitch( 1173 pass_command_line = pass_command_line && !parsed_command_line().HasSwitch(
1162 switches::kCheckCloudPrintConnectorPolicy); 1174 switches::kCheckCloudPrintConnectorPolicy);
1163 1175
1164 if (pass_command_line) { 1176 if (pass_command_line) {
1165 // When another process is running, use that process instead of starting a 1177 // When another process is running, use that process instead of starting a
1166 // new one. NotifyOtherProcess will currently give the other process up to 1178 // new one. NotifyOtherProcess will currently give the other process up to
1167 // 20 seconds to respond. Note that this needs to be done before we attempt 1179 // 20 seconds to respond. Note that this needs to be done before we attempt
1168 // to read the profile. 1180 // to read the profile.
1169 notify_result_ = process_singleton_->NotifyOtherProcessOrCreate(); 1181 notify_result_ = process_singleton_->NotifyOtherProcessOrCreate();
1170 UMA_HISTOGRAM_ENUMERATION("NotifyOtherProcessOrCreate.Result", 1182 UMA_HISTOGRAM_ENUMERATION("NotifyOtherProcessOrCreate.Result",
1171 notify_result_, 1183 notify_result_,
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
1255 if (!profile_) 1267 if (!profile_)
1256 return content::RESULT_CODE_NORMAL_EXIT; 1268 return content::RESULT_CODE_NORMAL_EXIT;
1257 1269
1258 #if defined(ENABLE_BACKGROUND) 1270 #if defined(ENABLE_BACKGROUND)
1259 // Autoload any profiles which are running background apps. 1271 // Autoload any profiles which are running background apps.
1260 // TODO(rlp): Do this on a separate thread. See http://crbug.com/99075. 1272 // TODO(rlp): Do this on a separate thread. See http://crbug.com/99075.
1261 browser_process_->profile_manager()->AutoloadProfiles(); 1273 browser_process_->profile_manager()->AutoloadProfiles();
1262 #endif 1274 #endif
1263 // Post-profile init --------------------------------------------------------- 1275 // Post-profile init ---------------------------------------------------------
1264 1276
1277 #if !defined(OS_MACOSX) && !defined(OS_ANDROID)
1278 // Importing other browser settings is done in a browser-like process
1279 // that exits when this task has finished.
1280 // TODO(port): Port the Mac's IPC-based implementation to other platforms to
1281 // replace this implementation. http://crbug.com/22142
1282 if (ProfileManager::IsImportProcess(parsed_command_line())) {
1283 return first_run::ImportNow(profile_, parsed_command_line());
1284 }
1285 #endif
1286
1265 #if defined(OS_WIN) 1287 #if defined(OS_WIN)
1266 // Do the tasks if chrome has been upgraded while it was last running. 1288 // Do the tasks if chrome has been upgraded while it was last running.
1267 if (!already_running && upgrade_util::DoUpgradeTasks(parsed_command_line())) 1289 if (!already_running && upgrade_util::DoUpgradeTasks(parsed_command_line()))
1268 return content::RESULT_CODE_NORMAL_EXIT; 1290 return content::RESULT_CODE_NORMAL_EXIT;
1269 1291
1270 // Check if there is any machine level Chrome installed on the current 1292 // Check if there is any machine level Chrome installed on the current
1271 // machine. If yes and the current Chrome process is user level, we do not 1293 // machine. If yes and the current Chrome process is user level, we do not
1272 // allow the user level Chrome to run. So we notify the user and uninstall 1294 // allow the user level Chrome to run. So we notify the user and uninstall
1273 // user level Chrome. 1295 // user level Chrome.
1274 // Note this check should only happen here, after all the checks above 1296 // Note this check should only happen here, after all the checks above
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1310 #if !defined(OS_ANDROID) 1332 #if !defined(OS_ANDROID)
1311 // Show the First Run UI if this is the first time Chrome has been run on 1333 // Show the First Run UI if this is the first time Chrome has been run on
1312 // this computer, or we're being compelled to do so by a command line flag. 1334 // this computer, or we're being compelled to do so by a command line flag.
1313 // Note that this be done _after_ the PrefService is initialized and all 1335 // Note that this be done _after_ the PrefService is initialized and all
1314 // preferences are registered, since some of the code that the importer 1336 // preferences are registered, since some of the code that the importer
1315 // touches reads preferences. 1337 // touches reads preferences.
1316 if (do_first_run_tasks_) { 1338 if (do_first_run_tasks_) {
1317 first_run::AutoImport(profile_, 1339 first_run::AutoImport(profile_,
1318 master_prefs_->homepage_defined, 1340 master_prefs_->homepage_defined,
1319 master_prefs_->do_import_items, 1341 master_prefs_->do_import_items,
1320 master_prefs_->dont_import_items, 1342 master_prefs_->dont_import_items);
1321 master_prefs_->import_bookmarks_path);
1322
1323 // Note: this can pop the first run consent dialog on linux. 1343 // Note: this can pop the first run consent dialog on linux.
1324 first_run::DoPostImportTasks(profile_, master_prefs_->make_chrome_default); 1344 first_run::DoPostImportTasks(profile_, master_prefs_->make_chrome_default);
1325 1345
1326 browser_process_->profile_manager()->OnImportFinished(profile_); 1346 browser_process_->profile_manager()->OnImportFinished(profile_);
1327 1347
1328 if (!master_prefs_->suppress_first_run_default_browser_prompt) { 1348 if (!master_prefs_->suppress_first_run_default_browser_prompt) {
1329 browser_creator_->set_show_main_browser_window( 1349 browser_creator_->set_show_main_browser_window(
1330 !chrome::ShowFirstRunDefaultBrowserPrompt(profile_)); 1350 !chrome::ShowFirstRunDefaultBrowserPrompt(profile_));
1331 } else { 1351 } else {
1332 browser_creator_->set_is_default_browser_dialog_suppressed(true); 1352 browser_creator_->set_is_default_browser_dialog_suppressed(true);
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
1789 if (base::win::GetVersion() <= base::win::VERSION_XP) 1809 if (base::win::GetVersion() <= base::win::VERSION_XP)
1790 uma_name += "_XP"; 1810 uma_name += "_XP";
1791 1811
1792 uma_name += "_PreRead_"; 1812 uma_name += "_PreRead_";
1793 uma_name += pre_read_percentage; 1813 uma_name += pre_read_percentage;
1794 AddPreReadHistogramTime(uma_name.c_str(), time); 1814 AddPreReadHistogramTime(uma_name.c_str(), time);
1795 } 1815 }
1796 #endif 1816 #endif
1797 #endif 1817 #endif
1798 } 1818 }
OLDNEW
« no previous file with comments | « no previous file | trunk/src/chrome/browser/extensions/extension_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698