| Index: chrome/browser/chromeos/policy/network_configuration_updater.cc
|
| diff --git a/chrome/browser/chromeos/policy/network_configuration_updater.cc b/chrome/browser/chromeos/policy/network_configuration_updater.cc
|
| index ce72dd8bd4a5e9ce111c63bfd9886135aa5f5b79..fb5d4089bfc07418d9e94732f57b366b06f33ae7 100644
|
| --- a/chrome/browser/chromeos/policy/network_configuration_updater.cc
|
| +++ b/chrome/browser/chromeos/policy/network_configuration_updater.cc
|
| @@ -37,6 +37,17 @@ void NetworkConfigurationUpdater::OnPolicyServiceInitialized(
|
| }
|
| }
|
|
|
| +void NetworkConfigurationUpdater::SetCertDatabase(
|
| + net::NSSCertDatabase* cert_database) {
|
| + DCHECK(!cert_database_);
|
| + cert_database_ = cert_database;
|
| +
|
| + // If the policy service is ready, the policy has to be reapplied to ensure
|
| + // certificates are imported.
|
| + if (policy_service_->IsInitializationComplete(POLICY_DOMAIN_CHROME))
|
| + ApplyPolicy();
|
| +}
|
| +
|
| NetworkConfigurationUpdater::NetworkConfigurationUpdater(
|
| onc::ONCSource onc_source,
|
| std::string policy_key,
|
| @@ -50,7 +61,8 @@ NetworkConfigurationUpdater::NetworkConfigurationUpdater(
|
| policy_change_registrar_(policy_service,
|
| PolicyNamespace(POLICY_DOMAIN_CHROME,
|
| std::string())),
|
| - policy_service_(policy_service) {
|
| + policy_service_(policy_service),
|
| + cert_database_(NULL) {
|
| }
|
|
|
| void NetworkConfigurationUpdater::Init() {
|
| @@ -95,7 +107,8 @@ void NetworkConfigurationUpdater::ApplyPolicy() {
|
| &global_network_config,
|
| &certificates);
|
|
|
| - ImportCertificates(certificates);
|
| + if (cert_database_)
|
| + ImportCertificates(certificates, cert_database_);
|
| ApplyNetworkPolicy(&network_configs, &global_network_config);
|
| }
|
|
|
|
|