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/chrome_browser_main.h" | 5 #include "chrome/browser/chrome_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 1556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1567 // Pass the TokenService pointer to the policy connector so user policy can | 1567 // Pass the TokenService pointer to the policy connector so user policy can |
1568 // grab a token and register with the policy server. | 1568 // grab a token and register with the policy server. |
1569 // TODO(mnissler): Remove once OAuth is the only authentication mechanism. | 1569 // TODO(mnissler): Remove once OAuth is the only authentication mechanism. |
1570 if (parsed_command_line().HasSwitch(switches::kLoginUser) && | 1570 if (parsed_command_line().HasSwitch(switches::kLoginUser) && |
1571 !parsed_command_line().HasSwitch(switches::kLoginPassword)) { | 1571 !parsed_command_line().HasSwitch(switches::kLoginPassword)) { |
1572 g_browser_process->browser_policy_connector()->SetUserPolicyTokenService( | 1572 g_browser_process->browser_policy_connector()->SetUserPolicyTokenService( |
1573 profile_->GetTokenService()); | 1573 profile_->GetTokenService()); |
1574 } | 1574 } |
1575 #endif | 1575 #endif |
1576 | 1576 |
1577 // Tests should be able to tune login manager before showing it. | |
1578 // Thus only show login manager in normal (non-testing) mode. | |
1579 if (!parameters().ui_task) | |
1580 OptionallyRunChromeOSLoginManager(parsed_command_line(), profile_); | |
1581 | |
1582 #if !defined(OS_MACOSX) | 1577 #if !defined(OS_MACOSX) |
1583 // Importing other browser settings is done in a browser-like process | 1578 // Importing other browser settings is done in a browser-like process |
1584 // that exits when this task has finished. | 1579 // that exits when this task has finished. |
1585 // TODO(port): Port the Mac's IPC-based implementation to other platforms to | 1580 // TODO(port): Port the Mac's IPC-based implementation to other platforms to |
1586 // replace this implementation. http://crbug.com/22142 | 1581 // replace this implementation. http://crbug.com/22142 |
1587 if (parsed_command_line().HasSwitch(switches::kImport) || | 1582 if (parsed_command_line().HasSwitch(switches::kImport) || |
1588 parsed_command_line().HasSwitch(switches::kImportFromFile)) { | 1583 parsed_command_line().HasSwitch(switches::kImportFromFile)) { |
1589 return FirstRun::ImportNow(profile_, parsed_command_line()); | 1584 return FirstRun::ImportNow(profile_, parsed_command_line()); |
1590 } | 1585 } |
1591 #endif | 1586 #endif |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1853 // Called from MainMessageLoopRun(). | 1848 // Called from MainMessageLoopRun(). |
1854 void ChromeBrowserMainParts::StartBrowserOrUITask() { | 1849 void ChromeBrowserMainParts::StartBrowserOrUITask() { |
1855 // Still initializing, so need to allow IO. | 1850 // Still initializing, so need to allow IO. |
1856 base::ThreadRestrictions::ScopedAllowIO allow_io; | 1851 base::ThreadRestrictions::ScopedAllowIO allow_io; |
1857 | 1852 |
1858 // Set the notification UI manager after any desktop initialization in | 1853 // Set the notification UI manager after any desktop initialization in |
1859 // PreMainMessageLoopRun() is complete, and before starting the browser. | 1854 // PreMainMessageLoopRun() is complete, and before starting the browser. |
1860 DesktopNotificationServiceFactory::GetForProfile(profile_)->SetUIManager( | 1855 DesktopNotificationServiceFactory::GetForProfile(profile_)->SetUIManager( |
1861 g_browser_process->notification_ui_manager()); | 1856 g_browser_process->notification_ui_manager()); |
1862 | 1857 |
| 1858 // Tests should be able to tune login manager before showing it. |
| 1859 // Thus only show login manager in normal (non-testing) mode. |
| 1860 if (!parameters().ui_task) |
| 1861 OptionallyRunChromeOSLoginManager(parsed_command_line(), profile_); |
| 1862 |
1863 if (parameters().ui_task) { | 1863 if (parameters().ui_task) { |
1864 // We are in test mode. Run one task and enter the main message loop. | 1864 // We are in test mode. Run one task and enter the main message loop. |
1865 #if defined(OS_MACOSX) | 1865 #if defined(OS_MACOSX) |
1866 if (parameters().autorelease_pool) | 1866 if (parameters().autorelease_pool) |
1867 parameters().autorelease_pool->Recycle(); | 1867 parameters().autorelease_pool->Recycle(); |
1868 #endif | 1868 #endif |
1869 parameters().ui_task->Run(); | 1869 parameters().ui_task->Run(); |
1870 delete parameters().ui_task; | 1870 delete parameters().ui_task; |
1871 run_message_loop_ = false; | 1871 run_message_loop_ = false; |
1872 } else { | 1872 } else { |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2084 if (env->GetVar(chrome::kPreReadEnvironmentVariable, &pre_read) && | 2084 if (env->GetVar(chrome::kPreReadEnvironmentVariable, &pre_read) && |
2085 (pre_read == "0" || pre_read == "1")) { | 2085 (pre_read == "0" || pre_read == "1")) { |
2086 std::string uma_name(name); | 2086 std::string uma_name(name); |
2087 uma_name += "_PreRead"; | 2087 uma_name += "_PreRead"; |
2088 uma_name += pre_read == "1" ? "Enabled" : "Disabled"; | 2088 uma_name += pre_read == "1" ? "Enabled" : "Disabled"; |
2089 AddPreReadHistogramTime(uma_name.c_str(), time); | 2089 AddPreReadHistogramTime(uma_name.c_str(), time); |
2090 } | 2090 } |
2091 #endif | 2091 #endif |
2092 #endif | 2092 #endif |
2093 } | 2093 } |
OLD | NEW |