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/chromeos/login/login_utils.h" | 5 #include "chrome/browser/chromeos/login/login_utils.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
13 #include "base/location.h" | 13 #include "base/location.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/memory/singleton.h" | 16 #include "base/memory/singleton.h" |
17 #include "base/path_service.h" | 17 #include "base/path_service.h" |
18 #include "base/string_util.h" | 18 #include "base/string_util.h" |
19 #include "base/stringprintf.h" | 19 #include "base/stringprintf.h" |
20 #include "base/synchronization/lock.h" | 20 #include "base/synchronization/lock.h" |
21 #include "base/threading/thread_restrictions.h" | 21 #include "base/threading/thread_restrictions.h" |
22 #include "base/time.h" | 22 #include "base/time.h" |
23 #include "base/utf_string_conversions.h" | 23 #include "base/utf_string_conversions.h" |
24 #include "chrome/browser/browser_process.h" | 24 #include "chrome/browser/browser_process.h" |
25 #include "chrome/browser/browser_shutdown.h" | 25 #include "chrome/browser/browser_shutdown.h" |
26 #include "chrome/browser/chromeos/boot_times_loader.h" | 26 #include "chrome/browser/chromeos/boot_times_loader.h" |
27 #include "chrome/browser/chromeos/cros/login_library.h" | |
28 #include "chrome/browser/chromeos/cros/network_library.h" | 27 #include "chrome/browser/chromeos/cros/network_library.h" |
| 28 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" |
| 29 #include "chrome/browser/chromeos/dbus/session_manager_client.h" |
29 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 30 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
30 #include "chrome/browser/chromeos/input_method/input_method_util.h" | 31 #include "chrome/browser/chromeos/input_method/input_method_util.h" |
31 #include "chrome/browser/chromeos/login/background_view.h" | 32 #include "chrome/browser/chromeos/login/background_view.h" |
32 #include "chrome/browser/chromeos/login/cookie_fetcher.h" | 33 #include "chrome/browser/chromeos/login/cookie_fetcher.h" |
33 #include "chrome/browser/chromeos/login/google_authenticator.h" | 34 #include "chrome/browser/chromeos/login/google_authenticator.h" |
34 #include "chrome/browser/chromeos/login/language_switch_menu.h" | 35 #include "chrome/browser/chromeos/login/language_switch_menu.h" |
35 #include "chrome/browser/chromeos/login/login_display_host.h" | 36 #include "chrome/browser/chromeos/login/login_display_host.h" |
36 #include "chrome/browser/chromeos/login/ownership_service.h" | 37 #include "chrome/browser/chromeos/login/ownership_service.h" |
37 #include "chrome/browser/chromeos/login/parallel_authenticator.h" | 38 #include "chrome/browser/chromeos/login/parallel_authenticator.h" |
38 #include "chrome/browser/chromeos/login/screen_locker.h" | 39 #include "chrome/browser/chromeos/login/screen_locker.h" |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 BrowserThread::FILE, FROM_HERE, | 378 BrowserThread::FILE, FROM_HERE, |
378 base::Bind(&JobRestartRequest::RestartJob, this)); | 379 base::Bind(&JobRestartRequest::RestartJob, this)); |
379 } else { | 380 } else { |
380 RestartJob(); | 381 RestartJob(); |
381 } | 382 } |
382 } | 383 } |
383 | 384 |
384 private: | 385 private: |
385 void RestartJob() { | 386 void RestartJob() { |
386 if (BrowserThread::CurrentlyOn(BrowserThread::UI)) { | 387 if (BrowserThread::CurrentlyOn(BrowserThread::UI)) { |
387 CrosLibrary::Get()->GetLoginLibrary()->RestartJob( | 388 DBusThreadManager::Get()->session_manager_client()->RestartJob( |
388 pid_, command_line_); | 389 pid_, command_line_); |
389 } else { | 390 } else { |
390 // This function can be called on FILE thread. See PostTask in the | 391 // This function can be called on FILE thread. See PostTask in the |
391 // constructor. | 392 // constructor. |
392 BrowserThread::PostTask( | 393 BrowserThread::PostTask( |
393 BrowserThread::UI, FROM_HERE, | 394 BrowserThread::UI, FROM_HERE, |
394 NewRunnableMethod(this, &JobRestartRequest::RestartJob)); | 395 NewRunnableMethod(this, &JobRestartRequest::RestartJob)); |
395 MessageLoop::current()->AssertIdle(); | 396 MessageLoop::current()->AssertIdle(); |
396 } | 397 } |
397 } | 398 } |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 bool pending_requests, | 571 bool pending_requests, |
571 bool using_oauth, | 572 bool using_oauth, |
572 bool has_cookies, | 573 bool has_cookies, |
573 LoginUtils::Delegate* delegate) { | 574 LoginUtils::Delegate* delegate) { |
574 BootTimesLoader* btl = BootTimesLoader::Get(); | 575 BootTimesLoader* btl = BootTimesLoader::Get(); |
575 | 576 |
576 VLOG(1) << "Completing login for " << username; | 577 VLOG(1) << "Completing login for " << username; |
577 | 578 |
578 if (CrosLibrary::Get()->EnsureLoaded()) { | 579 if (CrosLibrary::Get()->EnsureLoaded()) { |
579 btl->AddLoginTimeMarker("StartSession-Start", false); | 580 btl->AddLoginTimeMarker("StartSession-Start", false); |
580 CrosLibrary::Get()->GetLoginLibrary()->StartSession(username, ""); | 581 DBusThreadManager::Get()->session_manager_client()->StartSession( |
| 582 username); |
581 btl->AddLoginTimeMarker("StartSession-End", false); | 583 btl->AddLoginTimeMarker("StartSession-End", false); |
582 } | 584 } |
583 | 585 |
584 btl->AddLoginTimeMarker("UserLoggedIn-Start", false); | 586 btl->AddLoginTimeMarker("UserLoggedIn-Start", false); |
585 UserManager::Get()->UserLoggedIn(username); | 587 UserManager::Get()->UserLoggedIn(username); |
586 btl->AddLoginTimeMarker("UserLoggedIn-End", false); | 588 btl->AddLoginTimeMarker("UserLoggedIn-End", false); |
587 | 589 |
588 // Switch log file as soon as possible. | 590 // Switch log file as soon as possible. |
589 logging::RedirectChromeLogging(*(CommandLine::ForCurrentProcess())); | 591 logging::RedirectChromeLogging(*(CommandLine::ForCurrentProcess())); |
590 | 592 |
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1218 // Mark login host for deletion after browser starts. This | 1220 // Mark login host for deletion after browser starts. This |
1219 // guarantees that the message loop will be referenced by the | 1221 // guarantees that the message loop will be referenced by the |
1220 // browser before it is dereferenced by the login host. | 1222 // browser before it is dereferenced by the login host. |
1221 if (login_host) { | 1223 if (login_host) { |
1222 login_host->OnSessionStart(); | 1224 login_host->OnSessionStart(); |
1223 login_host = NULL; | 1225 login_host = NULL; |
1224 } | 1226 } |
1225 } | 1227 } |
1226 | 1228 |
1227 } // namespace chromeos | 1229 } // namespace chromeos |
OLD | NEW |