OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/browser_main.h" | 5 #include "chrome/browser/browser_main.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1069 | 1069 |
1070 ProcessSingleton process_singleton(user_data_dir); | 1070 ProcessSingleton process_singleton(user_data_dir); |
1071 | 1071 |
1072 bool is_first_run = FirstRun::IsChromeFirstRun() || | 1072 bool is_first_run = FirstRun::IsChromeFirstRun() || |
1073 parsed_command_line.HasSwitch(switches::kFirstRun); | 1073 parsed_command_line.HasSwitch(switches::kFirstRun); |
1074 | 1074 |
1075 scoped_ptr<BrowserProcessImpl> browser_process; | 1075 scoped_ptr<BrowserProcessImpl> browser_process; |
1076 if (parsed_command_line.HasSwitch(switches::kImport) || | 1076 if (parsed_command_line.HasSwitch(switches::kImport) || |
1077 parsed_command_line.HasSwitch(switches::kImportFromFile)) { | 1077 parsed_command_line.HasSwitch(switches::kImportFromFile)) { |
1078 // We use different BrowserProcess when importing so no GoogleURLTracker is | 1078 // We use different BrowserProcess when importing so no GoogleURLTracker is |
1079 // instantiated (as it makes a URLRequest and we don't have an IO thread, | 1079 // instantiated (as it makes a net::URLRequest and we don't have an IO |
1080 // see bug #1292702). | 1080 // thread, see bug #1292702). |
1081 browser_process.reset(new FirstRunBrowserProcess(parsed_command_line)); | 1081 browser_process.reset(new FirstRunBrowserProcess(parsed_command_line)); |
1082 is_first_run = false; | 1082 is_first_run = false; |
1083 } else { | 1083 } else { |
1084 browser_process.reset(new BrowserProcessImpl(parsed_command_line)); | 1084 browser_process.reset(new BrowserProcessImpl(parsed_command_line)); |
1085 } | 1085 } |
1086 | 1086 |
1087 // BrowserProcessImpl's constructor should set g_browser_process. | 1087 // BrowserProcessImpl's constructor should set g_browser_process. |
1088 DCHECK(g_browser_process); | 1088 DCHECK(g_browser_process); |
1089 | 1089 |
1090 // This forces the TabCloseableStateWatcher to be created and, on chromeos, | 1090 // This forces the TabCloseableStateWatcher to be created and, on chromeos, |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1314 // Initialize the screen locker now so that it can receive | 1314 // Initialize the screen locker now so that it can receive |
1315 // LOGIN_USER_CHANGED notification from UserManager. | 1315 // LOGIN_USER_CHANGED notification from UserManager. |
1316 chromeos::ScreenLocker::InitClass(); | 1316 chromeos::ScreenLocker::InitClass(); |
1317 | 1317 |
1318 // This forces the ProfileManager to be created and register for the | 1318 // This forces the ProfileManager to be created and register for the |
1319 // notification it needs to track the logged in user. | 1319 // notification it needs to track the logged in user. |
1320 g_browser_process->profile_manager()->GetDefaultProfile(); | 1320 g_browser_process->profile_manager()->GetDefaultProfile(); |
1321 | 1321 |
1322 // Allow access to file:// on ChromeOS for tests. | 1322 // Allow access to file:// on ChromeOS for tests. |
1323 if (parsed_command_line.HasSwitch(switches::kAllowFileAccess)) { | 1323 if (parsed_command_line.HasSwitch(switches::kAllowFileAccess)) { |
1324 URLRequest::AllowFileAccess(); | 1324 net::URLRequest::AllowFileAccess(); |
1325 } | 1325 } |
1326 | 1326 |
1327 // There are two use cases for kLoginUser: | 1327 // There are two use cases for kLoginUser: |
1328 // 1) if passed in tandem with kLoginPassword, to drive a "StubLogin" | 1328 // 1) if passed in tandem with kLoginPassword, to drive a "StubLogin" |
1329 // 2) if passed alone, to signal that the indicated user has already | 1329 // 2) if passed alone, to signal that the indicated user has already |
1330 // logged in and we should behave accordingly. | 1330 // logged in and we should behave accordingly. |
1331 // This handles case 2. | 1331 // This handles case 2. |
1332 if (parsed_command_line.HasSwitch(switches::kLoginUser) && | 1332 if (parsed_command_line.HasSwitch(switches::kLoginUser) && |
1333 !parsed_command_line.HasSwitch(switches::kLoginPassword)) { | 1333 !parsed_command_line.HasSwitch(switches::kLoginPassword)) { |
1334 std::string username = | 1334 std::string username = |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1696 #if defined(OS_CHROMEOS) | 1696 #if defined(OS_CHROMEOS) |
1697 // To be precise, logout (browser shutdown) is not yet done, but the | 1697 // To be precise, logout (browser shutdown) is not yet done, but the |
1698 // remaining work is negligible, hence we say LogoutDone here. | 1698 // remaining work is negligible, hence we say LogoutDone here. |
1699 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", | 1699 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", |
1700 false); | 1700 false); |
1701 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); | 1701 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); |
1702 #endif | 1702 #endif |
1703 TRACE_EVENT_END("BrowserMain", 0, 0); | 1703 TRACE_EVENT_END("BrowserMain", 0, 0); |
1704 return result_code; | 1704 return result_code; |
1705 } | 1705 } |
OLD | NEW |