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 1397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1408 NOTREACHED(); | 1408 NOTREACHED(); |
1409 } | 1409 } |
1410 #if !defined(OS_MACOSX) // closing brace for if | 1410 #if !defined(OS_MACOSX) // closing brace for if |
1411 } | 1411 } |
1412 #endif | 1412 #endif |
1413 | 1413 |
1414 #if defined(USE_X11) | 1414 #if defined(USE_X11) |
1415 SetBrowserX11ErrorHandlers(); | 1415 SetBrowserX11ErrorHandlers(); |
1416 #endif | 1416 #endif |
1417 | 1417 |
| 1418 // Override the default ContentBrowserClient to let Chrome participate in |
| 1419 // content logic. Must be done before any tabs are created or the profile is |
| 1420 // created. |
| 1421 chrome::ChromeContentBrowserClient browser_client; |
| 1422 content::GetContentClient()->set_browser(&browser_client); |
| 1423 |
1418 // Profile creation ---------------------------------------------------------- | 1424 // Profile creation ---------------------------------------------------------- |
1419 | 1425 |
1420 #if defined(OS_CHROMEOS) | 1426 #if defined(OS_CHROMEOS) |
1421 // Stub out chromeos implementations. | 1427 // Stub out chromeos implementations. |
1422 if (parsed_command_line.HasSwitch(switches::kStubCros)) | 1428 if (parsed_command_line.HasSwitch(switches::kStubCros)) |
1423 chromeos::CrosLibrary::Get()->GetTestApi()->SetUseStubImpl(); | 1429 chromeos::CrosLibrary::Get()->GetTestApi()->SetUseStubImpl(); |
1424 | 1430 |
1425 // Initialize the screen locker now so that it can receive | 1431 // Initialize the screen locker now so that it can receive |
1426 // LOGIN_USER_CHANGED notification from UserManager. | 1432 // LOGIN_USER_CHANGED notification from UserManager. |
1427 chromeos::ScreenLocker::InitClass(); | 1433 chromeos::ScreenLocker::InitClass(); |
(...skipping 26 matching lines...) Expand all Loading... |
1454 | 1460 |
1455 Profile* profile = CreateProfile(parameters, user_data_dir); | 1461 Profile* profile = CreateProfile(parameters, user_data_dir); |
1456 if (!profile) | 1462 if (!profile) |
1457 return ResultCodes::NORMAL_EXIT; | 1463 return ResultCodes::NORMAL_EXIT; |
1458 | 1464 |
1459 // Post-profile init --------------------------------------------------------- | 1465 // Post-profile init --------------------------------------------------------- |
1460 | 1466 |
1461 PrefService* user_prefs = profile->GetPrefs(); | 1467 PrefService* user_prefs = profile->GetPrefs(); |
1462 DCHECK(user_prefs); | 1468 DCHECK(user_prefs); |
1463 | 1469 |
1464 // Override the default ContentBrowserClient to let Chrome participate in | |
1465 // content logic. Must be done before any tabs are created. | |
1466 chrome::ChromeContentBrowserClient browser_client; | |
1467 content::GetContentClient()->set_browser(&browser_client); | |
1468 | |
1469 // Tests should be able to tune login manager before showing it. | 1470 // Tests should be able to tune login manager before showing it. |
1470 // Thus only show login manager in normal (non-testing) mode. | 1471 // Thus only show login manager in normal (non-testing) mode. |
1471 if (!parameters.ui_task) { | 1472 if (!parameters.ui_task) { |
1472 OptionallyRunChromeOSLoginManager(parsed_command_line); | 1473 OptionallyRunChromeOSLoginManager(parsed_command_line); |
1473 } | 1474 } |
1474 | 1475 |
1475 #if !defined(OS_MACOSX) | 1476 #if !defined(OS_MACOSX) |
1476 // Importing other browser settings is done in a browser-like process | 1477 // Importing other browser settings is done in a browser-like process |
1477 // that exits when this task has finished. | 1478 // that exits when this task has finished. |
1478 // TODO(port): Port the Mac's IPC-based implementation to other platforms to | 1479 // TODO(port): Port the Mac's IPC-based implementation to other platforms to |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1878 #if defined(OS_CHROMEOS) | 1879 #if defined(OS_CHROMEOS) |
1879 // To be precise, logout (browser shutdown) is not yet done, but the | 1880 // To be precise, logout (browser shutdown) is not yet done, but the |
1880 // remaining work is negligible, hence we say LogoutDone here. | 1881 // remaining work is negligible, hence we say LogoutDone here. |
1881 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", | 1882 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", |
1882 false); | 1883 false); |
1883 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); | 1884 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); |
1884 #endif | 1885 #endif |
1885 TRACE_EVENT_END("BrowserMain", 0, 0); | 1886 TRACE_EVENT_END("BrowserMain", 0, 0); |
1886 return result_code; | 1887 return result_code; |
1887 } | 1888 } |
OLD | NEW |