| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1194 browser_defaults::enable_help_app = false; | 1194 browser_defaults::enable_help_app = false; |
| 1195 | 1195 |
| 1196 scoped_ptr<BrowserMainParts> | 1196 scoped_ptr<BrowserMainParts> |
| 1197 parts(BrowserMainParts::CreateBrowserMainParts(parameters)); | 1197 parts(BrowserMainParts::CreateBrowserMainParts(parameters)); |
| 1198 | 1198 |
| 1199 parts->EarlyInitialization(); | 1199 parts->EarlyInitialization(); |
| 1200 | 1200 |
| 1201 // Must happen before we try to use a message loop or display any UI. | 1201 // Must happen before we try to use a message loop or display any UI. |
| 1202 InitializeToolkit(parameters); | 1202 InitializeToolkit(parameters); |
| 1203 | 1203 |
| 1204 #if defined(OS_CHROMEOS) |
| 1205 // Stub out chromeos implementations. We need to do as early as possible |
| 1206 // because it is initialized on first use when it is initialized |
| 1207 // SetUseStubImpl doesn't do anything. |
| 1208 if (parameters.command_line_.HasSwitch(switches::kStubCros)) |
| 1209 chromeos::CrosLibrary::Get()->GetTestApi()->SetUseStubImpl(); |
| 1210 #endif |
| 1211 |
| 1204 parts->MainMessageLoopStart(); | 1212 parts->MainMessageLoopStart(); |
| 1205 | 1213 |
| 1206 // WARNING: If we get a WM_ENDSESSION, objects created on the stack here | 1214 // WARNING: If we get a WM_ENDSESSION, objects created on the stack here |
| 1207 // are NOT deleted. If you need something to run during WM_ENDSESSION add it | 1215 // are NOT deleted. If you need something to run during WM_ENDSESSION add it |
| 1208 // to browser_shutdown::Shutdown or BrowserProcess::EndSession. | 1216 // to browser_shutdown::Shutdown or BrowserProcess::EndSession. |
| 1209 | 1217 |
| 1210 // !!!!!!!!!! READ ME !!!!!!!!!! | 1218 // !!!!!!!!!! READ ME !!!!!!!!!! |
| 1211 // I (viettrungluu) am in the process of refactoring |BrowserMain()|. If you | 1219 // I (viettrungluu) am in the process of refactoring |BrowserMain()|. If you |
| 1212 // need to add something above this comment, read the documentation in | 1220 // need to add something above this comment, read the documentation in |
| 1213 // browser_main.h. If you need to add something below, please do the | 1221 // browser_main.h. If you need to add something below, please do the |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1523 } | 1531 } |
| 1524 #endif | 1532 #endif |
| 1525 | 1533 |
| 1526 #if defined(USE_X11) | 1534 #if defined(USE_X11) |
| 1527 SetBrowserX11ErrorHandlers(); | 1535 SetBrowserX11ErrorHandlers(); |
| 1528 #endif | 1536 #endif |
| 1529 | 1537 |
| 1530 // Profile creation ---------------------------------------------------------- | 1538 // Profile creation ---------------------------------------------------------- |
| 1531 | 1539 |
| 1532 #if defined(OS_CHROMEOS) | 1540 #if defined(OS_CHROMEOS) |
| 1533 // Stub out chromeos implementations. | |
| 1534 if (parsed_command_line.HasSwitch(switches::kStubCros)) | |
| 1535 chromeos::CrosLibrary::Get()->GetTestApi()->SetUseStubImpl(); | |
| 1536 | |
| 1537 // Initialize the screen locker now so that it can receive | 1541 // Initialize the screen locker now so that it can receive |
| 1538 // LOGIN_USER_CHANGED notification from UserManager. | 1542 // LOGIN_USER_CHANGED notification from UserManager. |
| 1539 chromeos::ScreenLocker::InitClass(); | 1543 chromeos::ScreenLocker::InitClass(); |
| 1540 | 1544 |
| 1541 // This forces the ProfileManager to be created and register for the | 1545 // This forces the ProfileManager to be created and register for the |
| 1542 // notification it needs to track the logged in user. | 1546 // notification it needs to track the logged in user. |
| 1543 g_browser_process->profile_manager(); | 1547 g_browser_process->profile_manager(); |
| 1544 | 1548 |
| 1545 // TODO(abarth): Should this move to InitializeNetworkOptions()? | 1549 // TODO(abarth): Should this move to InitializeNetworkOptions()? |
| 1546 // Allow access to file:// on ChromeOS for tests. | 1550 // Allow access to file:// on ChromeOS for tests. |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1949 #if defined(OS_CHROMEOS) | 1953 #if defined(OS_CHROMEOS) |
| 1950 // To be precise, logout (browser shutdown) is not yet done, but the | 1954 // To be precise, logout (browser shutdown) is not yet done, but the |
| 1951 // remaining work is negligible, hence we say LogoutDone here. | 1955 // remaining work is negligible, hence we say LogoutDone here. |
| 1952 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", | 1956 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", |
| 1953 false); | 1957 false); |
| 1954 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); | 1958 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); |
| 1955 #endif | 1959 #endif |
| 1956 TRACE_EVENT_END_ETW("BrowserMain", 0, 0); | 1960 TRACE_EVENT_END_ETW("BrowserMain", 0, 0); |
| 1957 return result_code; | 1961 return result_code; |
| 1958 } | 1962 } |
| OLD | NEW |