Chromium Code Reviews| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 53 #include "chrome/browser/chromeos/login/ui/input_events_blocker.h" | 53 #include "chrome/browser/chromeos/login/ui/input_events_blocker.h" |
| 54 #include "chrome/browser/chromeos/login/ui/login_display_host.h" | 54 #include "chrome/browser/chromeos/login/ui/login_display_host.h" |
| 55 #include "chrome/browser/chromeos/login/user_flow.h" | 55 #include "chrome/browser/chromeos/login/user_flow.h" |
| 56 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" | 56 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" |
| 57 #include "chrome/browser/chromeos/login/users/supervised_user_manager.h" | 57 #include "chrome/browser/chromeos/login/users/supervised_user_manager.h" |
| 58 #include "chrome/browser/chromeos/login/wizard_controller.h" | 58 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 59 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 59 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 60 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 60 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 61 #include "chrome/browser/chromeos/settings/cros_settings.h" | 61 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 62 #include "chrome/browser/component_updater/ev_whitelist_component_installer.h" | 62 #include "chrome/browser/component_updater/ev_whitelist_component_installer.h" |
| 63 #include "chrome/browser/component_updater/sth_set_component_installer.h" | |
| 63 #include "chrome/browser/first_run/first_run.h" | 64 #include "chrome/browser/first_run/first_run.h" |
| 64 #include "chrome/browser/google/google_brand_chromeos.h" | 65 #include "chrome/browser/google/google_brand_chromeos.h" |
| 65 #include "chrome/browser/lifetime/application_lifetime.h" | 66 #include "chrome/browser/lifetime/application_lifetime.h" |
| 66 #include "chrome/browser/net/crl_set_fetcher.h" | 67 #include "chrome/browser/net/crl_set_fetcher.h" |
| 67 #include "chrome/browser/net/nss_context.h" | 68 #include "chrome/browser/net/nss_context.h" |
| 68 #include "chrome/browser/prefs/session_startup_pref.h" | 69 #include "chrome/browser/prefs/session_startup_pref.h" |
| 69 #include "chrome/browser/profiles/profile.h" | 70 #include "chrome/browser/profiles/profile.h" |
| 70 #include "chrome/browser/profiles/profile_manager.h" | 71 #include "chrome/browser/profiles/profile_manager.h" |
| 71 #include "chrome/browser/signin/account_tracker_service_factory.h" | 72 #include "chrome/browser/signin/account_tracker_service_factory.h" |
| 72 #include "chrome/browser/signin/easy_unlock_service.h" | 73 #include "chrome/browser/signin/easy_unlock_service.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 105 #include "components/signin/core/browser/account_tracker_service.h" | 106 #include "components/signin/core/browser/account_tracker_service.h" |
| 106 #include "components/signin/core/browser/signin_manager_base.h" | 107 #include "components/signin/core/browser/signin_manager_base.h" |
| 107 #include "components/user_manager/known_user.h" | 108 #include "components/user_manager/known_user.h" |
| 108 #include "components/user_manager/user.h" | 109 #include "components/user_manager/user.h" |
| 109 #include "components/user_manager/user_manager.h" | 110 #include "components/user_manager/user_manager.h" |
| 110 #include "components/user_manager/user_type.h" | 111 #include "components/user_manager/user_type.h" |
| 111 #include "content/public/browser/browser_thread.h" | 112 #include "content/public/browser/browser_thread.h" |
| 112 #include "content/public/browser/notification_service.h" | 113 #include "content/public/browser/notification_service.h" |
| 113 #include "content/public/browser/storage_partition.h" | 114 #include "content/public/browser/storage_partition.h" |
| 114 #include "content/public/common/content_switches.h" | 115 #include "content/public/common/content_switches.h" |
| 116 #include "net/cert/sth_distributor.h" | |
| 115 #include "ui/base/ime/chromeos/input_method_descriptor.h" | 117 #include "ui/base/ime/chromeos/input_method_descriptor.h" |
| 116 #include "ui/base/ime/chromeos/input_method_manager.h" | 118 #include "ui/base/ime/chromeos/input_method_manager.h" |
| 117 #include "url/gurl.h" | 119 #include "url/gurl.h" |
| 118 | 120 |
| 119 #if defined(ENABLE_RLZ) | 121 #if defined(ENABLE_RLZ) |
| 120 #include "chrome/browser/rlz/chrome_rlz_tracker_delegate.h" | 122 #include "chrome/browser/rlz/chrome_rlz_tracker_delegate.h" |
| 121 #include "components/rlz/rlz_tracker.h" | 123 #include "components/rlz/rlz_tracker.h" |
| 122 #endif | 124 #endif |
| 123 | 125 |
| 124 namespace chromeos { | 126 namespace chromeos { |
| (...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1141 content::NotificationService::AllSources(), | 1143 content::NotificationService::AllSources(), |
| 1142 content::Details<Profile>(profile)); | 1144 content::Details<Profile>(profile)); |
| 1143 | 1145 |
| 1144 // Initialize various services only for primary user. | 1146 // Initialize various services only for primary user. |
| 1145 const user_manager::User* user = | 1147 const user_manager::User* user = |
| 1146 ProfileHelper::Get()->GetUserByProfile(profile); | 1148 ProfileHelper::Get()->GetUserByProfile(profile); |
| 1147 if (user_manager->GetPrimaryUser() == user) { | 1149 if (user_manager->GetPrimaryUser() == user) { |
| 1148 InitRlz(profile); | 1150 InitRlz(profile); |
| 1149 InitializeCerts(profile); | 1151 InitializeCerts(profile); |
| 1150 InitializeCRLSetFetcher(user); | 1152 InitializeCRLSetFetcher(user); |
| 1151 InitializeEVCertificatesWhitelistComponent(user); | 1153 InitializeCertificateTransparencyComponents(user); |
| 1152 | 1154 |
| 1153 if (arc::ArcBridgeService::GetEnabled( | 1155 if (arc::ArcBridgeService::GetEnabled( |
| 1154 base::CommandLine::ForCurrentProcess())) { | 1156 base::CommandLine::ForCurrentProcess())) { |
| 1155 DCHECK(arc::ArcServiceManager::Get()); | 1157 DCHECK(arc::ArcServiceManager::Get()); |
| 1156 arc::ArcServiceManager::Get()->OnPrimaryUserProfilePrepared( | 1158 arc::ArcServiceManager::Get()->OnPrimaryUserProfilePrepared( |
| 1157 multi_user_util::GetAccountIdFromProfile(profile)); | 1159 multi_user_util::GetAccountIdFromProfile(profile)); |
| 1158 arc::ArcAuthService::Get()->OnPrimaryUserProfilePrepared(profile); | 1160 arc::ArcAuthService::Get()->OnPrimaryUserProfilePrepared(profile); |
| 1159 } | 1161 } |
| 1160 } | 1162 } |
| 1161 | 1163 |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1408 base::FilePath path; | 1410 base::FilePath path; |
| 1409 path = ProfileHelper::GetProfilePathByUserIdHash(username_hash); | 1411 path = ProfileHelper::GetProfilePathByUserIdHash(username_hash); |
| 1410 component_updater::ComponentUpdateService* cus = | 1412 component_updater::ComponentUpdateService* cus = |
| 1411 g_browser_process->component_updater(); | 1413 g_browser_process->component_updater(); |
| 1412 CRLSetFetcher* crl_set = g_browser_process->crl_set_fetcher(); | 1414 CRLSetFetcher* crl_set = g_browser_process->crl_set_fetcher(); |
| 1413 if (crl_set && cus) | 1415 if (crl_set && cus) |
| 1414 crl_set->StartInitialLoad(cus, path); | 1416 crl_set->StartInitialLoad(cus, path); |
| 1415 } | 1417 } |
| 1416 } | 1418 } |
| 1417 | 1419 |
| 1418 void UserSessionManager::InitializeEVCertificatesWhitelistComponent( | 1420 void UserSessionManager::InitializeCertificateTransparencyComponents( |
| 1419 const user_manager::User* user) { | 1421 const user_manager::User* user) { |
| 1420 const std::string username_hash = user->username_hash(); | 1422 const std::string username_hash = user->username_hash(); |
| 1421 component_updater::ComponentUpdateService* cus = | 1423 component_updater::ComponentUpdateService* cus = |
| 1422 g_browser_process->component_updater(); | 1424 g_browser_process->component_updater(); |
| 1423 if (!username_hash.empty() && cus) { | 1425 if (!username_hash.empty() && cus) { |
| 1424 const base::FilePath path = | 1426 const base::FilePath path = |
| 1425 ProfileHelper::GetProfilePathByUserIdHash(username_hash); | 1427 ProfileHelper::GetProfilePathByUserIdHash(username_hash); |
| 1428 // EV whitelist | |
| 1426 RegisterEVWhitelistComponent(cus, path); | 1429 RegisterEVWhitelistComponent(cus, path); |
| 1430 | |
| 1431 // TODO(eranm): Pass the distributor to the IOThread so CT | |
| 1432 // TreeStateTracker instances can register for STH updates. | |
|
Ryan Sleevi
2016/04/06 18:32:50
Can you file a bug? Mostly because I'm not sure wh
Eran Messeri
2016/04/07 11:38:02
Done - that TODO now lives in sth_set_component_in
| |
| 1433 scoped_ptr<net::ct::STHDistributor> distributor( | |
| 1434 new net::ct::STHDistributor()); | |
| 1435 // STH set fetcher. | |
| 1436 RegisterSTHSetComponent(cus, path, std::move(distributor)); | |
| 1427 } | 1437 } |
| 1428 } | 1438 } |
| 1429 | 1439 |
| 1430 void UserSessionManager::OnRestoreActiveSessions( | 1440 void UserSessionManager::OnRestoreActiveSessions( |
| 1431 const SessionManagerClient::ActiveSessionsMap& sessions, | 1441 const SessionManagerClient::ActiveSessionsMap& sessions, |
| 1432 bool success) { | 1442 bool success) { |
| 1433 if (!success) { | 1443 if (!success) { |
| 1434 LOG(ERROR) << "Could not get list of active user sessions after crash."; | 1444 LOG(ERROR) << "Could not get list of active user sessions after crash."; |
| 1435 // If we could not get list of active user sessions it is safer to just | 1445 // If we could not get list of active user sessions it is safer to just |
| 1436 // sign out so that we don't get in the inconsistent state. | 1446 // sign out so that we don't get in the inconsistent state. |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1812 token_handle_util_.reset(); | 1822 token_handle_util_.reset(); |
| 1813 first_run::GoodiesDisplayer::Delete(); | 1823 first_run::GoodiesDisplayer::Delete(); |
| 1814 } | 1824 } |
| 1815 | 1825 |
| 1816 void UserSessionManager::CreateTokenUtilIfMissing() { | 1826 void UserSessionManager::CreateTokenUtilIfMissing() { |
| 1817 if (!token_handle_util_.get()) | 1827 if (!token_handle_util_.get()) |
| 1818 token_handle_util_.reset(new TokenHandleUtil()); | 1828 token_handle_util_.reset(new TokenHandleUtil()); |
| 1819 } | 1829 } |
| 1820 | 1830 |
| 1821 } // namespace chromeos | 1831 } // namespace chromeos |
| OLD | NEW |