| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/user_manager_impl.h" | 5 #include "chrome/browser/chromeos/login/user_manager_impl.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 #include "chrome/browser/chromeos/login/login_display.h" | 34 #include "chrome/browser/chromeos/login/login_display.h" |
| 35 #include "chrome/browser/chromeos/login/login_utils.h" | 35 #include "chrome/browser/chromeos/login/login_utils.h" |
| 36 #include "chrome/browser/chromeos/login/multi_profile_first_run_notification.h" | 36 #include "chrome/browser/chromeos/login/multi_profile_first_run_notification.h" |
| 37 #include "chrome/browser/chromeos/login/multi_profile_user_controller.h" | 37 #include "chrome/browser/chromeos/login/multi_profile_user_controller.h" |
| 38 #include "chrome/browser/chromeos/login/remove_user_delegate.h" | 38 #include "chrome/browser/chromeos/login/remove_user_delegate.h" |
| 39 #include "chrome/browser/chromeos/login/supervised_user_manager_impl.h" | 39 #include "chrome/browser/chromeos/login/supervised_user_manager_impl.h" |
| 40 #include "chrome/browser/chromeos/login/user_image_manager_impl.h" | 40 #include "chrome/browser/chromeos/login/user_image_manager_impl.h" |
| 41 #include "chrome/browser/chromeos/login/wizard_controller.h" | 41 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 42 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 42 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 43 #include "chrome/browser/chromeos/policy/device_local_account.h" | 43 #include "chrome/browser/chromeos/policy/device_local_account.h" |
| 44 #include "chrome/browser/chromeos/profiles/multiprofiles_session_aborted_dialog.
h" |
| 44 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 45 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 45 #include "chrome/browser/chromeos/session_length_limiter.h" | 46 #include "chrome/browser/chromeos/session_length_limiter.h" |
| 46 #include "chrome/browser/lifetime/application_lifetime.h" | |
| 47 #include "chrome/browser/profiles/profile.h" | 47 #include "chrome/browser/profiles/profile.h" |
| 48 #include "chrome/browser/profiles/profile_manager.h" | 48 #include "chrome/browser/profiles/profile_manager.h" |
| 49 #include "chrome/browser/sync/profile_sync_service.h" | 49 #include "chrome/browser/sync/profile_sync_service.h" |
| 50 #include "chrome/browser/sync/profile_sync_service_factory.h" | 50 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 51 #include "chrome/common/chrome_constants.h" | 51 #include "chrome/common/chrome_constants.h" |
| 52 #include "chrome/common/chrome_switches.h" | 52 #include "chrome/common/chrome_switches.h" |
| 53 #include "chrome/common/crash_keys.h" | 53 #include "chrome/common/crash_keys.h" |
| 54 #include "chrome/common/pref_names.h" | 54 #include "chrome/common/pref_names.h" |
| 55 #include "chromeos/chromeos_switches.h" | 55 #include "chromeos/chromeos_switches.h" |
| 56 #include "chromeos/cryptohome/async_method_caller.h" | 56 #include "chromeos/cryptohome/async_method_caller.h" |
| (...skipping 1866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1923 const base::TimeDelta time_to_login = | 1923 const base::TimeDelta time_to_login = |
| 1924 base::TimeTicks::Now() - manager_creation_time_; | 1924 base::TimeTicks::Now() - manager_creation_time_; |
| 1925 if (!last_email.empty() && user_id != last_email && | 1925 if (!last_email.empty() && user_id != last_email && |
| 1926 time_to_login.InSeconds() <= kLogoutToLoginDelayMaxSec) { | 1926 time_to_login.InSeconds() <= kLogoutToLoginDelayMaxSec) { |
| 1927 UMA_HISTOGRAM_CUSTOM_COUNTS("UserManager.LogoutToLoginDelay", | 1927 UMA_HISTOGRAM_CUSTOM_COUNTS("UserManager.LogoutToLoginDelay", |
| 1928 time_to_login.InSeconds(), 0, kLogoutToLoginDelayMaxSec, 50); | 1928 time_to_login.InSeconds(), 0, kLogoutToLoginDelayMaxSec, 50); |
| 1929 } | 1929 } |
| 1930 } | 1930 } |
| 1931 } | 1931 } |
| 1932 | 1932 |
| 1933 void UserManagerImpl::OnUserNotAllowed() { | 1933 void UserManagerImpl::OnUserNotAllowed(const std::string& user_email) { |
| 1934 LOG(ERROR) << "Shutdown session because a user is not allowed to be in the " | 1934 LOG(ERROR) << "Shutdown session because a user is not allowed to be in the " |
| 1935 "current session"; | 1935 "current session"; |
| 1936 chrome::AttemptUserExit(); | 1936 chromeos::ShowMultiprofilesSessionAbortedDialog(user_email); |
| 1937 } | 1937 } |
| 1938 | 1938 |
| 1939 void UserManagerImpl::UpdateUserAccountLocale(const std::string& user_id, | 1939 void UserManagerImpl::UpdateUserAccountLocale(const std::string& user_id, |
| 1940 const std::string& locale) { | 1940 const std::string& locale) { |
| 1941 if (!locale.empty() && | 1941 if (!locale.empty() && |
| 1942 locale != g_browser_process->GetApplicationLocale()) { | 1942 locale != g_browser_process->GetApplicationLocale()) { |
| 1943 BrowserThread::PostBlockingPoolTask( | 1943 BrowserThread::PostBlockingPoolTask( |
| 1944 FROM_HERE, | 1944 FROM_HERE, |
| 1945 base::Bind(ResolveLocale, locale, | 1945 base::Bind(ResolveLocale, locale, |
| 1946 base::Bind(&UserManagerImpl::DoUpdateAccountLocale, | 1946 base::Bind(&UserManagerImpl::DoUpdateAccountLocale, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1957 if (User* user = FindUserAndModify(user_id)) | 1957 if (User* user = FindUserAndModify(user_id)) |
| 1958 user->SetAccountLocale(resolved_locale); | 1958 user->SetAccountLocale(resolved_locale); |
| 1959 } | 1959 } |
| 1960 | 1960 |
| 1961 void UserManagerImpl::UpdateNumberOfUsers() { | 1961 void UserManagerImpl::UpdateNumberOfUsers() { |
| 1962 base::debug::SetCrashKeyValue(crash_keys::kNumberOfUsers, | 1962 base::debug::SetCrashKeyValue(crash_keys::kNumberOfUsers, |
| 1963 base::StringPrintf("%" PRIuS, GetLoggedInUsers().size())); | 1963 base::StringPrintf("%" PRIuS, GetLoggedInUsers().size())); |
| 1964 } | 1964 } |
| 1965 | 1965 |
| 1966 } // namespace chromeos | 1966 } // namespace chromeos |
| OLD | NEW |