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

Unified Diff: chrome/browser/chromeos/policy/user_network_configuration_updater_factory.cc

Issue 419013003: Replace c/b/nss_context by a KeyedService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Flattened components/cert_database folders. Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/policy/user_network_configuration_updater_factory.cc
diff --git a/chrome/browser/chromeos/policy/user_network_configuration_updater_factory.cc b/chrome/browser/chromeos/policy/user_network_configuration_updater_factory.cc
index 6db58c9f856b13914db27ee9ad76a536ed904e93..70e0723883af7d321113c5d52e9d034f6759b2c1 100644
--- a/chrome/browser/chromeos/policy/user_network_configuration_updater_factory.cc
+++ b/chrome/browser/chromeos/policy/user_network_configuration_updater_factory.cc
@@ -7,16 +7,20 @@
#include "base/memory/singleton.h"
#include "chrome/browser/chromeos/policy/user_network_configuration_updater.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
+#include "chrome/browser/net/cert_database_service_factory.h"
#include "chrome/browser/policy/profile_policy_connector.h"
#include "chrome/browser/policy/profile_policy_connector_factory.h"
#include "chrome/browser/profiles/incognito_helpers.h"
#include "chrome/browser/profiles/profile.h"
#include "chromeos/network/network_handler.h"
+#include "chromeos/network/onc/onc_certificate_importer_impl.h"
+#include "components/cert_database/cert_database_service.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "components/policy/core/common/cloud/cloud_policy_constants.h"
#include "components/user_manager/user.h"
#include "components/user_manager/user_manager.h"
#include "components/user_manager/user_type.h"
+#include "content/public/browser/browser_thread.h"
namespace policy {
@@ -38,6 +42,7 @@ UserNetworkConfigurationUpdaterFactory::UserNetworkConfigurationUpdaterFactory()
"UserNetworkConfigurationUpdater",
BrowserContextDependencyManager::GetInstance()) {
DependsOn(ProfilePolicyConnectorFactory::GetInstance());
+ DependsOn(cert_database::CertDatabaseServiceFactory::GetInstance());
}
UserNetworkConfigurationUpdaterFactory::
@@ -79,13 +84,27 @@ KeyedService* UserNetworkConfigurationUpdaterFactory::BuildServiceInstanceFor(
ProfilePolicyConnector* profile_connector =
ProfilePolicyConnectorFactory::GetForProfile(profile);
+ cert_database::CertDatabaseService* cert_service =
+ cert_database::CertDatabaseServiceFactory::GetForBrowserContext(context);
+
+ if (!cert_service) {
+ LOG(ERROR) << "No CertDatabaseService available.";
+ return NULL;
+ }
+
+ scoped_ptr<chromeos::onc::CertificateImporter> certificate_importer(
+ new chromeos::onc::CertificateImporterImpl(
+ content::BrowserThread::GetMessageLoopProxyForThread(
+ content::BrowserThread::IO),
+ cert_service->GetIOPart()));
+
return UserNetworkConfigurationUpdater::CreateForUserPolicy(
- profile,
- allow_trusted_certs_from_policy,
- *user,
- profile_connector->policy_service(),
- chromeos::NetworkHandler::Get()->managed_network_configuration_handler())
- .release();
+ allow_trusted_certs_from_policy,
+ *user,
+ profile_connector->policy_service(),
+ certificate_importer.Pass(),
+ chromeos::NetworkHandler::Get()
+ ->managed_network_configuration_handler()).release();
}
} // namespace policy

Powered by Google App Engine
This is Rietveld 408576698