| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "chrome/browser/chromeos/login/ui/input_events_blocker.h" | 42 #include "chrome/browser/chromeos/login/ui/input_events_blocker.h" |
| 43 #include "chrome/browser/chromeos/login/ui/login_display_host.h" | 43 #include "chrome/browser/chromeos/login/ui/login_display_host.h" |
| 44 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" | 44 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" |
| 45 #include "chrome/browser/chromeos/login/user_flow.h" | 45 #include "chrome/browser/chromeos/login/user_flow.h" |
| 46 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" | 46 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" |
| 47 #include "chrome/browser/chromeos/login/users/supervised_user_manager.h" | 47 #include "chrome/browser/chromeos/login/users/supervised_user_manager.h" |
| 48 #include "chrome/browser/chromeos/login/wizard_controller.h" | 48 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 49 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 49 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 50 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 50 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 51 #include "chrome/browser/chromeos/settings/cros_settings.h" | 51 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 52 #include "chrome/browser/component_updater/ev_whitelist_component_installer.h" |
| 52 #include "chrome/browser/first_run/first_run.h" | 53 #include "chrome/browser/first_run/first_run.h" |
| 53 #include "chrome/browser/google/google_brand_chromeos.h" | 54 #include "chrome/browser/google/google_brand_chromeos.h" |
| 54 #include "chrome/browser/lifetime/application_lifetime.h" | 55 #include "chrome/browser/lifetime/application_lifetime.h" |
| 55 #include "chrome/browser/net/crl_set_fetcher.h" | 56 #include "chrome/browser/net/crl_set_fetcher.h" |
| 56 #include "chrome/browser/net/nss_context.h" | 57 #include "chrome/browser/net/nss_context.h" |
| 57 #include "chrome/browser/pref_service_flags_storage.h" | 58 #include "chrome/browser/pref_service_flags_storage.h" |
| 58 #include "chrome/browser/prefs/session_startup_pref.h" | 59 #include "chrome/browser/prefs/session_startup_pref.h" |
| 59 #include "chrome/browser/profiles/profile.h" | 60 #include "chrome/browser/profiles/profile.h" |
| 60 #include "chrome/browser/profiles/profile_manager.h" | 61 #include "chrome/browser/profiles/profile_manager.h" |
| 61 #include "chrome/browser/rlz/rlz.h" | 62 #include "chrome/browser/rlz/rlz.h" |
| (...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 960 content::NotificationService::AllSources(), | 961 content::NotificationService::AllSources(), |
| 961 content::Details<Profile>(profile)); | 962 content::Details<Profile>(profile)); |
| 962 | 963 |
| 963 // Initialize various services only for primary user. | 964 // Initialize various services only for primary user. |
| 964 const user_manager::User* user = | 965 const user_manager::User* user = |
| 965 ProfileHelper::Get()->GetUserByProfile(profile); | 966 ProfileHelper::Get()->GetUserByProfile(profile); |
| 966 if (user_manager->GetPrimaryUser() == user) { | 967 if (user_manager->GetPrimaryUser() == user) { |
| 967 InitRlz(profile); | 968 InitRlz(profile); |
| 968 InitializeCerts(profile); | 969 InitializeCerts(profile); |
| 969 InitializeCRLSetFetcher(user); | 970 InitializeCRLSetFetcher(user); |
| 971 InitializeEVCertificatesWhitelistComponent(user); |
| 970 } | 972 } |
| 971 | 973 |
| 972 UpdateEasyUnlockKeys(user_context_); | 974 UpdateEasyUnlockKeys(user_context_); |
| 973 user_context_.ClearSecrets(); | 975 user_context_.ClearSecrets(); |
| 974 | 976 |
| 975 // Now that profile is ready, proceed to either alternative login flows or | 977 // Now that profile is ready, proceed to either alternative login flows or |
| 976 // launch browser. | 978 // launch browser. |
| 977 bool browser_launched = InitializeUserSession(profile); | 979 bool browser_launched = InitializeUserSession(profile); |
| 978 | 980 |
| 979 // TODO(nkostylev): This pointer should probably never be NULL, but it looks | 981 // TODO(nkostylev): This pointer should probably never be NULL, but it looks |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1189 base::FilePath path; | 1191 base::FilePath path; |
| 1190 path = ProfileHelper::GetProfilePathByUserIdHash(username_hash); | 1192 path = ProfileHelper::GetProfilePathByUserIdHash(username_hash); |
| 1191 component_updater::ComponentUpdateService* cus = | 1193 component_updater::ComponentUpdateService* cus = |
| 1192 g_browser_process->component_updater(); | 1194 g_browser_process->component_updater(); |
| 1193 CRLSetFetcher* crl_set = g_browser_process->crl_set_fetcher(); | 1195 CRLSetFetcher* crl_set = g_browser_process->crl_set_fetcher(); |
| 1194 if (crl_set && cus) | 1196 if (crl_set && cus) |
| 1195 crl_set->StartInitialLoad(cus, path); | 1197 crl_set->StartInitialLoad(cus, path); |
| 1196 } | 1198 } |
| 1197 } | 1199 } |
| 1198 | 1200 |
| 1201 void UserSessionManager::InitializeEVCertificatesWhitelistComponent( |
| 1202 const user_manager::User* user) { |
| 1203 const std::string username_hash = user->username_hash(); |
| 1204 component_updater::ComponentUpdateService* cus = |
| 1205 g_browser_process->component_updater(); |
| 1206 if (!username_hash.empty() && cus) { |
| 1207 const base::FilePath path = |
| 1208 ProfileHelper::GetProfilePathByUserIdHash(username_hash); |
| 1209 RegisterEVWhitelistComponent(cus, path); |
| 1210 } |
| 1211 } |
| 1212 |
| 1199 void UserSessionManager::OnRestoreActiveSessions( | 1213 void UserSessionManager::OnRestoreActiveSessions( |
| 1200 const SessionManagerClient::ActiveSessionsMap& sessions, | 1214 const SessionManagerClient::ActiveSessionsMap& sessions, |
| 1201 bool success) { | 1215 bool success) { |
| 1202 if (!success) { | 1216 if (!success) { |
| 1203 LOG(ERROR) << "Could not get list of active user sessions after crash."; | 1217 LOG(ERROR) << "Could not get list of active user sessions after crash."; |
| 1204 // If we could not get list of active user sessions it is safer to just | 1218 // If we could not get list of active user sessions it is safer to just |
| 1205 // sign out so that we don't get in the inconsistent state. | 1219 // sign out so that we don't get in the inconsistent state. |
| 1206 DBusThreadManager::Get()->GetSessionManagerClient()->StopSession(); | 1220 DBusThreadManager::Get()->GetSessionManagerClient()->StopSession(); |
| 1207 return; | 1221 return; |
| 1208 } | 1222 } |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1479 | 1493 |
| 1480 // static | 1494 // static |
| 1481 void UserSessionManager::RunCallbackOnLocaleLoaded( | 1495 void UserSessionManager::RunCallbackOnLocaleLoaded( |
| 1482 const base::Closure& callback, | 1496 const base::Closure& callback, |
| 1483 InputEventsBlocker* /* input_events_blocker */, | 1497 InputEventsBlocker* /* input_events_blocker */, |
| 1484 const locale_util::LanguageSwitchResult& /* result */) { | 1498 const locale_util::LanguageSwitchResult& /* result */) { |
| 1485 callback.Run(); | 1499 callback.Run(); |
| 1486 } | 1500 } |
| 1487 | 1501 |
| 1488 } // namespace chromeos | 1502 } // namespace chromeos |
| OLD | NEW |