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

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

Issue 419013003: Replace c/b/nss_context by a KeyedService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added Linux implementation. Created 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/policy/user_network_configuration_updater.cc
diff --git a/chrome/browser/chromeos/policy/user_network_configuration_updater.cc b/chrome/browser/chromeos/policy/user_network_configuration_updater.cc
index 447677e70d70c142f7a400b79b8cfc6d40923ef8..4ae9c95125cd0241417a8f01ee82676dac4a4511 100644
--- a/chrome/browser/chromeos/policy/user_network_configuration_updater.cc
+++ b/chrome/browser/chromeos/policy/user_network_configuration_updater.cc
@@ -8,14 +8,11 @@
#include "base/bind_helpers.h"
#include "base/logging.h"
#include "base/values.h"
-#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/chromeos/net/onc_utils.h"
-#include "chrome/browser/net/nss_context.h"
#include "chrome/browser/profiles/profile.h"
#include "chromeos/network/managed_network_configuration_handler.h"
#include "chromeos/network/onc/onc_certificate_importer_impl.h"
#include "components/user_manager/user.h"
-#include "content/public/browser/notification_source.h"
#include "net/cert/x509_certificate.h"
#include "policy/policy_constants.h"
@@ -64,14 +61,6 @@ UserNetworkConfigurationUpdater::UserNetworkConfigurationUpdater(
allow_trusted_certificates_from_policy_(allow_trusted_certs_from_policy),
user_(&user),
weak_factory_(this) {
- // The updater is created with |certificate_importer_| unset and is
- // responsible for creating it. This requires |GetNSSCertDatabaseForProfile|
- // call, which is not safe before the profile initialization is finalized.
- // Thus, listen for PROFILE_ADDED notification, on which |cert_importer_|
- // creation should start.
- registrar_.Add(this,
- chrome::NOTIFICATION_PROFILE_ADDED,
- content::Source<Profile>(profile));
}
void UserNetworkConfigurationUpdater::SetCertificateImporterForTest(
@@ -114,20 +103,6 @@ void UserNetworkConfigurationUpdater::ApplyNetworkPolicy(
*global_network_config);
}
-void UserNetworkConfigurationUpdater::Observe(
- int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
- DCHECK_EQ(type, chrome::NOTIFICATION_PROFILE_ADDED);
- Profile* profile = content::Source<Profile>(source).ptr();
-
- GetNSSCertDatabaseForProfile(
- profile,
- base::Bind(
- &UserNetworkConfigurationUpdater::CreateAndSetCertificateImporter,
- weak_factory_.GetWeakPtr()));
-}
-
void UserNetworkConfigurationUpdater::CreateAndSetCertificateImporter(
net::NSSCertDatabase* database) {
DCHECK(database);
@@ -137,6 +112,7 @@ void UserNetworkConfigurationUpdater::CreateAndSetCertificateImporter(
void UserNetworkConfigurationUpdater::SetCertificateImporter(
scoped_ptr<chromeos::onc::CertificateImporter> certificate_importer) {
+ DCHECK(!certificate_importer_);
certificate_importer_ = certificate_importer.Pass();
if (pending_certificates_onc_)

Powered by Google App Engine
This is Rietveld 408576698