Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(377)

Side by Side Diff: chrome/browser/chromeos/login/session/user_session_manager.cc

Issue 1853753003: Certificate Transparency: New component for obtaining fresh STHs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing review comments Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
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
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 // STH set fetcher.
1431 RegisterSTHSetComponent(cus, path);
1427 } 1432 }
1428 } 1433 }
1429 1434
1430 void UserSessionManager::OnRestoreActiveSessions( 1435 void UserSessionManager::OnRestoreActiveSessions(
1431 const SessionManagerClient::ActiveSessionsMap& sessions, 1436 const SessionManagerClient::ActiveSessionsMap& sessions,
1432 bool success) { 1437 bool success) {
1433 if (!success) { 1438 if (!success) {
1434 LOG(ERROR) << "Could not get list of active user sessions after crash."; 1439 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 1440 // 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. 1441 // sign out so that we don't get in the inconsistent state.
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
1812 token_handle_util_.reset(); 1817 token_handle_util_.reset();
1813 first_run::GoodiesDisplayer::Delete(); 1818 first_run::GoodiesDisplayer::Delete();
1814 } 1819 }
1815 1820
1816 void UserSessionManager::CreateTokenUtilIfMissing() { 1821 void UserSessionManager::CreateTokenUtilIfMissing() {
1817 if (!token_handle_util_.get()) 1822 if (!token_handle_util_.get())
1818 token_handle_util_.reset(new TokenHandleUtil()); 1823 token_handle_util_.reset(new TokenHandleUtil());
1819 } 1824 }
1820 1825
1821 } // namespace chromeos 1826 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698