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

Side by Side Diff: chrome/browser/profiles/profile_io_data.cc

Issue 1306183007: Switch to id-based affiliation determination (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/profiles/profile_io_data.h" 5 #include "chrome/browser/profiles/profile_io_data.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 117
118 #if defined(OS_CHROMEOS) 118 #if defined(OS_CHROMEOS)
119 #include "chrome/browser/chromeos/certificate_provider/certificate_provider.h" 119 #include "chrome/browser/chromeos/certificate_provider/certificate_provider.h"
120 #include "chrome/browser/chromeos/certificate_provider/certificate_provider_serv ice.h" 120 #include "chrome/browser/chromeos/certificate_provider/certificate_provider_serv ice.h"
121 #include "chrome/browser/chromeos/certificate_provider/certificate_provider_serv ice_factory.h" 121 #include "chrome/browser/chromeos/certificate_provider/certificate_provider_serv ice_factory.h"
122 #include "chrome/browser/chromeos/fileapi/external_file_protocol_handler.h" 122 #include "chrome/browser/chromeos/fileapi/external_file_protocol_handler.h"
123 #include "chrome/browser/chromeos/login/startup_utils.h" 123 #include "chrome/browser/chromeos/login/startup_utils.h"
124 #include "chrome/browser/chromeos/net/cert_verify_proc_chromeos.h" 124 #include "chrome/browser/chromeos/net/cert_verify_proc_chromeos.h"
125 #include "chrome/browser/chromeos/net/client_cert_filter_chromeos.h" 125 #include "chrome/browser/chromeos/net/client_cert_filter_chromeos.h"
126 #include "chrome/browser/chromeos/net/client_cert_store_chromeos.h" 126 #include "chrome/browser/chromeos/net/client_cert_store_chromeos.h"
127 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
128 #include "chrome/browser/chromeos/policy/policy_cert_service.h" 127 #include "chrome/browser/chromeos/policy/policy_cert_service.h"
129 #include "chrome/browser/chromeos/policy/policy_cert_service_factory.h" 128 #include "chrome/browser/chromeos/policy/policy_cert_service_factory.h"
130 #include "chrome/browser/chromeos/policy/policy_cert_verifier.h" 129 #include "chrome/browser/chromeos/policy/policy_cert_verifier.h"
131 #include "chrome/browser/chromeos/profiles/profile_helper.h" 130 #include "chrome/browser/chromeos/profiles/profile_helper.h"
132 #include "chrome/browser/chromeos/settings/cros_settings.h" 131 #include "chrome/browser/chromeos/settings/cros_settings.h"
133 #include "chrome/browser/net/nss_context.h" 132 #include "chrome/browser/net/nss_context.h"
134 #include "chromeos/dbus/dbus_thread_manager.h" 133 #include "chromeos/dbus/dbus_thread_manager.h"
135 #include "chromeos/settings/cros_settings_names.h" 134 #include "chromeos/settings/cros_settings_names.h"
136 #include "chromeos/tpm/tpm_token_info_getter.h" 135 #include "chromeos/tpm/tpm_token_info_getter.h"
137 #include "components/user_manager/user.h" 136 #include "components/user_manager/user.h"
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 if (user && !user->username_hash().empty()) { 437 if (user && !user->username_hash().empty()) {
439 params->username_hash = user->username_hash(); 438 params->username_hash = user->username_hash();
440 DCHECK(!params->username_hash.empty()); 439 DCHECK(!params->username_hash.empty());
441 BrowserThread::PostTask(BrowserThread::IO, 440 BrowserThread::PostTask(BrowserThread::IO,
442 FROM_HERE, 441 FROM_HERE,
443 base::Bind(&StartNSSInitOnIOThread, 442 base::Bind(&StartNSSInitOnIOThread,
444 user->email(), 443 user->email(),
445 user->username_hash(), 444 user->username_hash(),
446 profile->GetPath())); 445 profile->GetPath()));
447 446
448 // Use the device-wide system key slot only if the user is of the same 447 // Use the device-wide system key slot only if the user is affiliated on
449 // domain as the device is registered to. 448 // the device.
450 policy::BrowserPolicyConnectorChromeOS* connector = 449 params->use_system_key_slot = user->is_affiliated();
451 g_browser_process->platform_part()
452 ->browser_policy_connector_chromeos();
453 params->use_system_key_slot =
454 connector->GetUserAffiliation(user->email()) ==
455 policy::USER_AFFILIATION_MANAGED;
456 } 450 }
457 } 451 }
458 452
459 chromeos::CertificateProviderService* cert_provider_service = 453 chromeos::CertificateProviderService* cert_provider_service =
460 chromeos::CertificateProviderServiceFactory::GetForBrowserContext( 454 chromeos::CertificateProviderServiceFactory::GetForBrowserContext(
461 profile); 455 profile);
462 if (cert_provider_service) { 456 if (cert_provider_service) {
463 params->certificate_provider = 457 params->certificate_provider =
464 cert_provider_service->CreateCertificateProvider(); 458 cert_provider_service->CreateCertificateProvider();
465 } 459 }
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after
1335 new DevToolsNetworkTransactionFactory( 1329 new DevToolsNetworkTransactionFactory(
1336 network_controller_handle_.GetController(), shared_session), 1330 network_controller_handle_.GetController(), shared_session),
1337 shared_session->net_log(), backend)); 1331 shared_session->net_log(), backend));
1338 } 1332 }
1339 1333
1340 void ProfileIOData::SetCookieSettingsForTesting( 1334 void ProfileIOData::SetCookieSettingsForTesting(
1341 content_settings::CookieSettings* cookie_settings) { 1335 content_settings::CookieSettings* cookie_settings) {
1342 DCHECK(!cookie_settings_.get()); 1336 DCHECK(!cookie_settings_.get());
1343 cookie_settings_ = cookie_settings; 1337 cookie_settings_ = cookie_settings;
1344 } 1338 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698