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 1812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1823 const User* user = (*it); | 1823 const User* user = (*it); |
1824 if (user->email() == user_id) { | 1824 if (user->email() == user_id) { |
1825 user_already_logged_in = true; | 1825 user_already_logged_in = true; |
1826 break; | 1826 break; |
1827 } | 1827 } |
1828 } | 1828 } |
1829 DCHECK(!user_already_logged_in); | 1829 DCHECK(!user_already_logged_in); |
1830 | 1830 |
1831 if (!user_already_logged_in) { | 1831 if (!user_already_logged_in) { |
1832 // Will call OnProfilePrepared() once profile has been loaded. | 1832 // Will call OnProfilePrepared() once profile has been loaded. |
1833 LoginUtils::Get()->PrepareProfile( | 1833 LoginUtils::Get()->PrepareProfile(UserContext(user_id, |
1834 UserContext(user_id, | 1834 std::string(), // password |
1835 std::string(), // password | 1835 std::string(), // auth_code |
1836 std::string(), // auth_code | 1836 user_id_hash, |
1837 user_id_hash, | 1837 false), // using_oauth |
1838 false, // using_oauth | 1838 std::string(), // display_email |
1839 UserContext::AUTH_FLOW_OFFLINE), | 1839 false, // has_cookies |
1840 std::string(), // display_email | 1840 true, // has_active_session |
1841 false, // has_cookies | 1841 this); |
1842 true, // has_active_session | |
1843 this); | |
1844 } else { | 1842 } else { |
1845 RestorePendingUserSessions(); | 1843 RestorePendingUserSessions(); |
1846 } | 1844 } |
1847 } | 1845 } |
1848 | 1846 |
1849 void UserManagerImpl::SendRegularUserLoginMetrics(const std::string& user_id) { | 1847 void UserManagerImpl::SendRegularUserLoginMetrics(const std::string& user_id) { |
1850 // If this isn't the first time Chrome was run after the system booted, | 1848 // If this isn't the first time Chrome was run after the system booted, |
1851 // assume that Chrome was restarted because a previous session ended. | 1849 // assume that Chrome was restarted because a previous session ended. |
1852 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 1850 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
1853 switches::kFirstExecAfterBoot)) { | 1851 switches::kFirstExecAfterBoot)) { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1890 if (User* user = FindUserAndModify(user_id)) | 1888 if (User* user = FindUserAndModify(user_id)) |
1891 user->SetAccountLocale(resolved_locale); | 1889 user->SetAccountLocale(resolved_locale); |
1892 } | 1890 } |
1893 | 1891 |
1894 void UserManagerImpl::UpdateNumberOfUsers() { | 1892 void UserManagerImpl::UpdateNumberOfUsers() { |
1895 base::debug::SetCrashKeyValue(crash_keys::kNumberOfUsers, | 1893 base::debug::SetCrashKeyValue(crash_keys::kNumberOfUsers, |
1896 base::StringPrintf("%" PRIuS, GetLoggedInUsers().size())); | 1894 base::StringPrintf("%" PRIuS, GetLoggedInUsers().size())); |
1897 } | 1895 } |
1898 | 1896 |
1899 } // namespace chromeos | 1897 } // namespace chromeos |
OLD | NEW |