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 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 const bool enable_layouts = UserManager::Get()->IsLoggedInAsGuest(); | 429 const bool enable_layouts = UserManager::Get()->IsLoggedInAsGuest(); |
430 locale_util::SwitchLanguage(pref_locale, | 430 locale_util::SwitchLanguage(pref_locale, |
431 enable_layouts, | 431 enable_layouts, |
432 false /* login_layouts_only */, | 432 false /* login_layouts_only */, |
433 callback.Pass()); | 433 callback.Pass()); |
434 | 434 |
435 return true; | 435 return true; |
436 } | 436 } |
437 | 437 |
438 void UserSessionManager::AddSessionStateObserver( | 438 void UserSessionManager::AddSessionStateObserver( |
439 UserSessionStateObserver* observer) { | 439 chromeos::UserSessionStateObserver* observer) { |
440 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 440 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
441 session_state_observer_list_.AddObserver(observer); | 441 session_state_observer_list_.AddObserver(observer); |
442 } | 442 } |
443 | 443 |
444 void UserSessionManager::RemoveSessionStateObserver( | 444 void UserSessionManager::RemoveSessionStateObserver( |
445 UserSessionStateObserver* observer) { | 445 chromeos::UserSessionStateObserver* observer) { |
446 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 446 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
447 session_state_observer_list_.RemoveObserver(observer); | 447 session_state_observer_list_.RemoveObserver(observer); |
448 } | 448 } |
449 | 449 |
450 void UserSessionManager::OnSessionRestoreStateChanged( | 450 void UserSessionManager::OnSessionRestoreStateChanged( |
451 Profile* user_profile, | 451 Profile* user_profile, |
452 OAuth2LoginManager::SessionRestoreState state) { | 452 OAuth2LoginManager::SessionRestoreState state) { |
453 user_manager::User::OAuthTokenStatus user_status = | 453 user_manager::User::OAuthTokenStatus user_status = |
454 user_manager::User::OAUTH_TOKEN_STATUS_UNKNOWN; | 454 user_manager::User::OAUTH_TOKEN_STATUS_UNKNOWN; |
455 OAuth2LoginManager* login_manager = | 455 OAuth2LoginManager* login_manager = |
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
965 true, // has_active_session | 965 true, // has_active_session |
966 this); | 966 this); |
967 } else { | 967 } else { |
968 RestorePendingUserSessions(); | 968 RestorePendingUserSessions(); |
969 } | 969 } |
970 } | 970 } |
971 | 971 |
972 void UserSessionManager::NotifyPendingUserSessionsRestoreFinished() { | 972 void UserSessionManager::NotifyPendingUserSessionsRestoreFinished() { |
973 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 973 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
974 user_sessions_restored_ = true; | 974 user_sessions_restored_ = true; |
975 FOR_EACH_OBSERVER(UserSessionStateObserver, | 975 FOR_EACH_OBSERVER(chromeos::UserSessionStateObserver, |
976 session_state_observer_list_, | 976 session_state_observer_list_, |
977 PendingUserSessionsRestoreFinished()); | 977 PendingUserSessionsRestoreFinished()); |
978 } | 978 } |
979 | 979 |
980 } // namespace chromeos | 980 } // namespace chromeos |
OLD | NEW |