| 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/users/user_manager_impl.h" | 5 #include "chrome/browser/chromeos/login/users/user_manager_impl.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "ash/multi_profile_uma.h" | 10 #include "ash/multi_profile_uma.h" |
| (...skipping 1996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2007 it != logged_in_users.end(); ++it) { | 2007 it != logged_in_users.end(); ++it) { |
| 2008 const User* user = (*it); | 2008 const User* user = (*it); |
| 2009 if (user->email() == user_id) { | 2009 if (user->email() == user_id) { |
| 2010 user_already_logged_in = true; | 2010 user_already_logged_in = true; |
| 2011 break; | 2011 break; |
| 2012 } | 2012 } |
| 2013 } | 2013 } |
| 2014 DCHECK(!user_already_logged_in); | 2014 DCHECK(!user_already_logged_in); |
| 2015 | 2015 |
| 2016 if (!user_already_logged_in) { | 2016 if (!user_already_logged_in) { |
| 2017 UserContext user_context(user_id); |
| 2018 user_context.SetUserIDHash(user_id_hash); |
| 2019 user_context.SetIsUsingOAuth(false); |
| 2017 // Will call OnProfilePrepared() once profile has been loaded. | 2020 // Will call OnProfilePrepared() once profile has been loaded. |
| 2018 LoginUtils::Get()->PrepareProfile( | 2021 LoginUtils::Get()->PrepareProfile(user_context, |
| 2019 UserContext(user_id, | 2022 std::string(), // display_email |
| 2020 std::string(), // password | 2023 false, // has_cookies |
| 2021 std::string(), // auth_code | 2024 true, // has_active_session |
| 2022 user_id_hash, | 2025 this); |
| 2023 false, // using_oauth | |
| 2024 UserContext::AUTH_FLOW_OFFLINE), | |
| 2025 std::string(), // display_email | |
| 2026 false, // has_cookies | |
| 2027 true, // has_active_session | |
| 2028 this); | |
| 2029 } else { | 2026 } else { |
| 2030 RestorePendingUserSessions(); | 2027 RestorePendingUserSessions(); |
| 2031 } | 2028 } |
| 2032 } | 2029 } |
| 2033 | 2030 |
| 2034 void UserManagerImpl::SendRegularUserLoginMetrics(const std::string& user_id) { | 2031 void UserManagerImpl::SendRegularUserLoginMetrics(const std::string& user_id) { |
| 2035 // If this isn't the first time Chrome was run after the system booted, | 2032 // If this isn't the first time Chrome was run after the system booted, |
| 2036 // assume that Chrome was restarted because a previous session ended. | 2033 // assume that Chrome was restarted because a previous session ended. |
| 2037 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 2034 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
| 2038 switches::kFirstExecAfterBoot)) { | 2035 switches::kFirstExecAfterBoot)) { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2089 } | 2086 } |
| 2090 | 2087 |
| 2091 void UserManagerImpl::DeleteUser(User* user) { | 2088 void UserManagerImpl::DeleteUser(User* user) { |
| 2092 const bool is_active_user = (user == active_user_); | 2089 const bool is_active_user = (user == active_user_); |
| 2093 delete user; | 2090 delete user; |
| 2094 if (is_active_user) | 2091 if (is_active_user) |
| 2095 active_user_ = NULL; | 2092 active_user_ = NULL; |
| 2096 } | 2093 } |
| 2097 | 2094 |
| 2098 } // namespace chromeos | 2095 } // namespace chromeos |
| OLD | NEW |