| 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/chromeos/login/login_utils.h" | 5 #include "chrome/browser/chromeos/login/login_utils.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/lock.h" | 10 #include "base/lock.h" |
| 11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 12 #include "base/scoped_ptr.h" | 12 #include "base/scoped_ptr.h" |
| 13 #include "base/singleton.h" | 13 #include "base/singleton.h" |
| 14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
| 15 #include "base/time.h" | 15 #include "base/time.h" |
| 16 #include "base/utf_string_conversions.h" | 16 #include "base/utf_string_conversions.h" |
| 17 #include "chrome/browser/browser_init.h" | 17 #include "chrome/browser/browser_init.h" |
| 18 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
| 19 #include "chrome/browser/chrome_thread.h" | 19 #include "chrome/browser/chrome_thread.h" |
| 20 #include "chrome/browser/chromeos/cros/login_library.h" | 20 #include "chrome/browser/chromeos/cros/login_library.h" |
| 21 #include "chrome/browser/chromeos/external_cookie_handler.h" | 21 #include "chrome/browser/chromeos/external_cookie_handler.h" |
| 22 #include "chrome/browser/chromeos/input_method/input_method_util.h" | 22 #include "chrome/browser/chromeos/input_method/input_method_util.h" |
| 23 #include "chrome/browser/chromeos/login/cookie_fetcher.h" | 23 #include "chrome/browser/chromeos/login/cookie_fetcher.h" |
| 24 #include "chrome/browser/chromeos/login/google_authenticator.h" | 24 #include "chrome/browser/chromeos/login/google_authenticator.h" |
| 25 #include "chrome/browser/chromeos/login/ownership_service.h" | 25 #include "chrome/browser/chromeos/login/ownership_service.h" |
| 26 #include "chrome/browser/chromeos/login/parallel_authenticator.h" |
| 26 #include "chrome/browser/chromeos/login/user_image_downloader.h" | 27 #include "chrome/browser/chromeos/login/user_image_downloader.h" |
| 27 #include "chrome/browser/chromeos/login/user_manager.h" | 28 #include "chrome/browser/chromeos/login/user_manager.h" |
| 28 #include "chrome/browser/net/gaia/token_service.h" | 29 #include "chrome/browser/net/gaia/token_service.h" |
| 29 #include "chrome/browser/prefs/pref_member.h" | 30 #include "chrome/browser/prefs/pref_member.h" |
| 30 #include "chrome/browser/profile.h" | 31 #include "chrome/browser/profile.h" |
| 31 #include "chrome/browser/profile_manager.h" | 32 #include "chrome/browser/profile_manager.h" |
| 32 #include "chrome/common/chrome_paths.h" | 33 #include "chrome/common/chrome_paths.h" |
| 33 #include "chrome/common/chrome_switches.h" | 34 #include "chrome/common/chrome_switches.h" |
| 34 #include "chrome/common/logging_chrome.h" | 35 #include "chrome/common/logging_chrome.h" |
| 35 #include "chrome/common/net/gaia/gaia_constants.h" | 36 #include "chrome/common/net/gaia/gaia_constants.h" |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 if (start_url.is_valid()) | 234 if (start_url.is_valid()) |
| 234 command_line.AppendArg(start_url.spec()); | 235 command_line.AppendArg(start_url.spec()); |
| 235 CrosLibrary::Get()->GetLoginLibrary()->RestartJob( | 236 CrosLibrary::Get()->GetLoginLibrary()->RestartJob( |
| 236 getpid(), | 237 getpid(), |
| 237 command_line.command_line_string()); | 238 command_line.command_line_string()); |
| 238 } | 239 } |
| 239 } | 240 } |
| 240 | 241 |
| 241 Authenticator* LoginUtilsImpl::CreateAuthenticator( | 242 Authenticator* LoginUtilsImpl::CreateAuthenticator( |
| 242 LoginStatusConsumer* consumer) { | 243 LoginStatusConsumer* consumer) { |
| 243 return new GoogleAuthenticator(consumer); | 244 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kParallelAuth)) |
| 245 return new ParallelAuthenticator(consumer); |
| 246 else |
| 247 return new GoogleAuthenticator(consumer); |
| 244 } | 248 } |
| 245 | 249 |
| 246 void LoginUtilsImpl::EnableBrowserLaunch(bool enable) { | 250 void LoginUtilsImpl::EnableBrowserLaunch(bool enable) { |
| 247 browser_launch_enabled_ = enable; | 251 browser_launch_enabled_ = enable; |
| 248 } | 252 } |
| 249 | 253 |
| 250 bool LoginUtilsImpl::IsBrowserLaunchEnabled() const { | 254 bool LoginUtilsImpl::IsBrowserLaunchEnabled() const { |
| 251 return browser_launch_enabled_; | 255 return browser_launch_enabled_; |
| 252 } | 256 } |
| 253 | 257 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 272 BrowserInit browser_init; | 276 BrowserInit browser_init; |
| 273 int return_code; | 277 int return_code; |
| 274 browser_init.LaunchBrowser(*CommandLine::ForCurrentProcess(), | 278 browser_init.LaunchBrowser(*CommandLine::ForCurrentProcess(), |
| 275 profile, | 279 profile, |
| 276 FilePath(), | 280 FilePath(), |
| 277 true, | 281 true, |
| 278 &return_code); | 282 &return_code); |
| 279 } | 283 } |
| 280 | 284 |
| 281 } // namespace chromeos | 285 } // namespace chromeos |
| OLD | NEW |