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" |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 BrowserThread::FILE, FROM_HERE, | 378 BrowserThread::FILE, FROM_HERE, |
379 base::Bind(&JobRestartRequest::RestartJob, this)); | 379 base::Bind(&JobRestartRequest::RestartJob, this)); |
380 } else { | 380 } else { |
381 RestartJob(); | 381 RestartJob(); |
382 } | 382 } |
383 } | 383 } |
384 | 384 |
385 private: | 385 private: |
386 void RestartJob() { | 386 void RestartJob() { |
387 if (BrowserThread::CurrentlyOn(BrowserThread::UI)) { | 387 if (BrowserThread::CurrentlyOn(BrowserThread::UI)) { |
388 DBusThreadManager::Get()->session_manager_client()->RestartJob( | 388 DBusThreadManager::Get()->GetSessionManagerClient()->RestartJob( |
389 pid_, command_line_); | 389 pid_, command_line_); |
390 } else { | 390 } else { |
391 // 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 |
392 // constructor. | 392 // constructor. |
393 BrowserThread::PostTask( | 393 BrowserThread::PostTask( |
394 BrowserThread::UI, FROM_HERE, | 394 BrowserThread::UI, FROM_HERE, |
395 NewRunnableMethod(this, &JobRestartRequest::RestartJob)); | 395 NewRunnableMethod(this, &JobRestartRequest::RestartJob)); |
396 MessageLoop::current()->AssertIdle(); | 396 MessageLoop::current()->AssertIdle(); |
397 } | 397 } |
398 } | 398 } |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 bool pending_requests, | 571 bool pending_requests, |
572 bool using_oauth, | 572 bool using_oauth, |
573 bool has_cookies, | 573 bool has_cookies, |
574 LoginUtils::Delegate* delegate) { | 574 LoginUtils::Delegate* delegate) { |
575 BootTimesLoader* btl = BootTimesLoader::Get(); | 575 BootTimesLoader* btl = BootTimesLoader::Get(); |
576 | 576 |
577 VLOG(1) << "Completing login for " << username; | 577 VLOG(1) << "Completing login for " << username; |
578 | 578 |
579 if (CrosLibrary::Get()->EnsureLoaded()) { | 579 if (CrosLibrary::Get()->EnsureLoaded()) { |
580 btl->AddLoginTimeMarker("StartSession-Start", false); | 580 btl->AddLoginTimeMarker("StartSession-Start", false); |
581 DBusThreadManager::Get()->session_manager_client()->StartSession( | 581 DBusThreadManager::Get()->GetSessionManagerClient()->StartSession( |
582 username); | 582 username); |
583 btl->AddLoginTimeMarker("StartSession-End", false); | 583 btl->AddLoginTimeMarker("StartSession-End", false); |
584 } | 584 } |
585 | 585 |
586 btl->AddLoginTimeMarker("UserLoggedIn-Start", false); | 586 btl->AddLoginTimeMarker("UserLoggedIn-Start", false); |
587 UserManager::Get()->UserLoggedIn(username); | 587 UserManager::Get()->UserLoggedIn(username); |
588 btl->AddLoginTimeMarker("UserLoggedIn-End", false); | 588 btl->AddLoginTimeMarker("UserLoggedIn-End", false); |
589 | 589 |
590 // Switch log file as soon as possible. | 590 // Switch log file as soon as possible. |
591 logging::RedirectChromeLogging(*(CommandLine::ForCurrentProcess())); | 591 logging::RedirectChromeLogging(*(CommandLine::ForCurrentProcess())); |
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1209 // Mark login host for deletion after browser starts. This | 1209 // Mark login host for deletion after browser starts. This |
1210 // guarantees that the message loop will be referenced by the | 1210 // guarantees that the message loop will be referenced by the |
1211 // browser before it is dereferenced by the login host. | 1211 // browser before it is dereferenced by the login host. |
1212 if (login_host) { | 1212 if (login_host) { |
1213 login_host->OnSessionStart(); | 1213 login_host->OnSessionStart(); |
1214 login_host = NULL; | 1214 login_host = NULL; |
1215 } | 1215 } |
1216 } | 1216 } |
1217 | 1217 |
1218 } // namespace chromeos | 1218 } // namespace chromeos |
OLD | NEW |