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 1477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1488 // Importing other browser settings is done in a browser-like process | 1488 // Importing other browser settings is done in a browser-like process |
1489 // that exits when this task has finished. | 1489 // that exits when this task has finished. |
1490 // TODO(port): Port the Mac's IPC-based implementation to other platforms to | 1490 // TODO(port): Port the Mac's IPC-based implementation to other platforms to |
1491 // replace this implementation. http://crbug.com/22142 | 1491 // replace this implementation. http://crbug.com/22142 |
1492 if (parsed_command_line.HasSwitch(switches::kImport) || | 1492 if (parsed_command_line.HasSwitch(switches::kImport) || |
1493 parsed_command_line.HasSwitch(switches::kImportFromFile)) { | 1493 parsed_command_line.HasSwitch(switches::kImportFromFile)) { |
1494 return FirstRun::ImportNow(profile, parsed_command_line); | 1494 return FirstRun::ImportNow(profile, parsed_command_line); |
1495 } | 1495 } |
1496 #endif | 1496 #endif |
1497 | 1497 |
| 1498 // The system request context can only be initialized once the |
| 1499 // PrefService has been initialized. |
| 1500 browser_process->InitSystemRequestContext(); |
| 1501 |
1498 #if defined(OS_WIN) | 1502 #if defined(OS_WIN) |
1499 // Do the tasks if chrome has been upgraded while it was last running. | 1503 // Do the tasks if chrome has been upgraded while it was last running. |
1500 if (!already_running && Upgrade::DoUpgradeTasks(parsed_command_line)) | 1504 if (!already_running && Upgrade::DoUpgradeTasks(parsed_command_line)) |
1501 return ResultCodes::NORMAL_EXIT; | 1505 return ResultCodes::NORMAL_EXIT; |
1502 #endif | 1506 #endif |
1503 | 1507 |
1504 // Check if there is any machine level Chrome installed on the current | 1508 // Check if there is any machine level Chrome installed on the current |
1505 // machine. If yes and the current Chrome process is user level, we do not | 1509 // machine. If yes and the current Chrome process is user level, we do not |
1506 // allow the user level Chrome to run. So we notify the user and uninstall | 1510 // allow the user level Chrome to run. So we notify the user and uninstall |
1507 // user level Chrome. | 1511 // user level Chrome. |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1851 #if defined(OS_CHROMEOS) | 1855 #if defined(OS_CHROMEOS) |
1852 // To be precise, logout (browser shutdown) is not yet done, but the | 1856 // To be precise, logout (browser shutdown) is not yet done, but the |
1853 // remaining work is negligible, hence we say LogoutDone here. | 1857 // remaining work is negligible, hence we say LogoutDone here. |
1854 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", | 1858 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", |
1855 false); | 1859 false); |
1856 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); | 1860 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); |
1857 #endif | 1861 #endif |
1858 TRACE_EVENT_END("BrowserMain", 0, 0); | 1862 TRACE_EVENT_END("BrowserMain", 0, 0); |
1859 return result_code; | 1863 return result_code; |
1860 } | 1864 } |
OLD | NEW |