OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/session/user_session_manager.h" | 5 #include "chrome/browser/chromeos/login/session/user_session_manager.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 } | 469 } |
470 } | 470 } |
471 | 471 |
472 void UserSessionManager::RestoreActiveSessions() { | 472 void UserSessionManager::RestoreActiveSessions() { |
473 user_sessions_restore_in_progress_ = true; | 473 user_sessions_restore_in_progress_ = true; |
474 DBusThreadManager::Get()->GetSessionManagerClient()->RetrieveActiveSessions( | 474 DBusThreadManager::Get()->GetSessionManagerClient()->RetrieveActiveSessions( |
475 base::Bind(&UserSessionManager::OnRestoreActiveSessions, AsWeakPtr())); | 475 base::Bind(&UserSessionManager::OnRestoreActiveSessions, AsWeakPtr())); |
476 } | 476 } |
477 | 477 |
478 bool UserSessionManager::UserSessionsRestored() const { | 478 bool UserSessionManager::UserSessionsRestored() const { |
479 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 479 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
480 return user_sessions_restored_; | 480 return user_sessions_restored_; |
481 } | 481 } |
482 | 482 |
483 bool UserSessionManager::UserSessionsRestoreInProgress() const { | 483 bool UserSessionManager::UserSessionsRestoreInProgress() const { |
484 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 484 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
485 return user_sessions_restore_in_progress_; | 485 return user_sessions_restore_in_progress_; |
486 } | 486 } |
487 | 487 |
488 void UserSessionManager::InitRlz(Profile* profile) { | 488 void UserSessionManager::InitRlz(Profile* profile) { |
489 #if defined(ENABLE_RLZ) | 489 #if defined(ENABLE_RLZ) |
490 if (!g_browser_process->local_state()->HasPrefPath(prefs::kRLZBrand)) { | 490 if (!g_browser_process->local_state()->HasPrefPath(prefs::kRLZBrand)) { |
491 // Read brand code asynchronously from an OEM data and repost ourselves. | 491 // Read brand code asynchronously from an OEM data and repost ourselves. |
492 google_brand::chromeos::InitBrand( | 492 google_brand::chromeos::InitBrand( |
493 base::Bind(&UserSessionManager::InitRlz, AsWeakPtr(), profile)); | 493 base::Bind(&UserSessionManager::InitRlz, AsWeakPtr(), profile)); |
494 return; | 494 return; |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 | 666 |
667 // Assumes only one deferred callback is needed. | 667 // Assumes only one deferred callback is needed. |
668 DCHECK(easy_unlock_key_ops_finished_callback_.is_null()); | 668 DCHECK(easy_unlock_key_ops_finished_callback_.is_null()); |
669 | 669 |
670 easy_unlock_key_ops_finished_callback_ = callback; | 670 easy_unlock_key_ops_finished_callback_ = callback; |
671 return true; | 671 return true; |
672 } | 672 } |
673 | 673 |
674 void UserSessionManager::AddSessionStateObserver( | 674 void UserSessionManager::AddSessionStateObserver( |
675 chromeos::UserSessionStateObserver* observer) { | 675 chromeos::UserSessionStateObserver* observer) { |
676 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 676 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
677 session_state_observer_list_.AddObserver(observer); | 677 session_state_observer_list_.AddObserver(observer); |
678 } | 678 } |
679 | 679 |
680 void UserSessionManager::RemoveSessionStateObserver( | 680 void UserSessionManager::RemoveSessionStateObserver( |
681 chromeos::UserSessionStateObserver* observer) { | 681 chromeos::UserSessionStateObserver* observer) { |
682 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 682 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
683 session_state_observer_list_.RemoveObserver(observer); | 683 session_state_observer_list_.RemoveObserver(observer); |
684 } | 684 } |
685 | 685 |
686 void UserSessionManager::OnSessionRestoreStateChanged( | 686 void UserSessionManager::OnSessionRestoreStateChanged( |
687 Profile* user_profile, | 687 Profile* user_profile, |
688 OAuth2LoginManager::SessionRestoreState state) { | 688 OAuth2LoginManager::SessionRestoreState state) { |
689 user_manager::User::OAuthTokenStatus user_status = | 689 user_manager::User::OAuthTokenStatus user_status = |
690 user_manager::User::OAUTH_TOKEN_STATUS_UNKNOWN; | 690 user_manager::User::OAUTH_TOKEN_STATUS_UNKNOWN; |
691 OAuth2LoginManager* login_manager = | 691 OAuth2LoginManager* login_manager = |
692 OAuth2LoginManagerFactory::GetInstance()->GetForProfile(user_profile); | 692 OAuth2LoginManagerFactory::GetInstance()->GetForProfile(user_profile); |
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1653 if (is_enterprise_managed) | 1653 if (is_enterprise_managed) |
1654 display = USER_PODS_DISPLAY_DISABLED_MANAGED; | 1654 display = USER_PODS_DISPLAY_DISABLED_MANAGED; |
1655 else | 1655 else |
1656 display = USER_PODS_DISPLAY_DISABLED_REGULAR; | 1656 display = USER_PODS_DISPLAY_DISABLED_REGULAR; |
1657 } | 1657 } |
1658 UMA_HISTOGRAM_ENUMERATION("UserSessionManager.UserPodsDisplay", display, | 1658 UMA_HISTOGRAM_ENUMERATION("UserSessionManager.UserPodsDisplay", display, |
1659 NUM_USER_PODS_DISPLAY); | 1659 NUM_USER_PODS_DISPLAY); |
1660 } | 1660 } |
1661 | 1661 |
1662 } // namespace chromeos | 1662 } // namespace chromeos |
OLD | NEW |