Index: chrome/browser/ui/webui/net_internals/net_internals_ui.cc |
diff --git a/chrome/browser/ui/webui/net_internals/net_internals_ui.cc b/chrome/browser/ui/webui/net_internals/net_internals_ui.cc |
index 09e64c33aa790f856cb36e17188b8e77aadea47e..273dd5b4d8a88a90091a4a9ccda0f68f24d96c04 100644 |
--- a/chrome/browser/ui/webui/net_internals/net_internals_ui.cc |
+++ b/chrome/browser/ui/webui/net_internals/net_internals_ui.cc |
@@ -76,11 +76,12 @@ |
#include "chrome/browser/chromeos/profiles/profile_helper.h" |
#include "chrome/browser/chromeos/system/syslogs_provider.h" |
#include "chrome/browser/chromeos/system_logs/debug_log_writer.h" |
-#include "chrome/browser/net/nss_context.h" |
+#include "chrome/browser/net/cert_database_service_factory.h" |
#include "chromeos/dbus/dbus_thread_manager.h" |
#include "chromeos/dbus/debug_daemon_client.h" |
#include "chromeos/network/onc/onc_certificate_importer_impl.h" |
#include "chromeos/network/onc/onc_utils.h" |
+#include "components/cert_database/public/cert_database_service.h" |
#include "components/user_manager/user.h" |
#endif |
@@ -238,13 +239,6 @@ class NetInternalsMessageHandler |
void OnSetNetworkDebugModeCompleted(const std::string& subsystem, |
bool succeeded); |
- // Callback to |GetNSSCertDatabaseForProfile| used to retrieve the database |
- // to which user's ONC defined certificates should be imported. |
- // It parses and imports |onc_blob|. |
- void ImportONCFileToNSSDB(const std::string& onc_blob, |
- const std::string& passcode, |
- net::NSSCertDatabase* nssdb); |
- |
// Called back by the CertificateImporter when a certificate import finished. |
// |previous_error| contains earlier errors during this import. |
void OnCertificatesImported( |
@@ -1163,10 +1157,14 @@ void NetInternalsMessageHandler::OnGetSystemLog( |
syslogs_getter_->RequestSystemLog(list); |
} |
-void NetInternalsMessageHandler::ImportONCFileToNSSDB( |
- const std::string& onc_blob, |
- const std::string& passcode, |
- net::NSSCertDatabase* nssdb) { |
+void NetInternalsMessageHandler::OnImportONCFile(const base::ListValue* list) { |
+ std::string onc_blob; |
+ std::string passcode; |
+ if (list->GetSize() != 2 || !list->GetString(0, &onc_blob) || |
+ !list->GetString(1, &passcode)) { |
+ NOTREACHED(); |
+ } |
+ |
user_manager::User* user = chromeos::ProfileHelper::Get()->GetUserByProfile( |
Profile::FromWebUI(web_ui())); |
@@ -1195,8 +1193,12 @@ void NetInternalsMessageHandler::ImportONCFileToNSSDB( |
if (!network_error.empty()) |
error += network_error; |
+ cert_database::CertDatabaseService* cert_service = |
+ cert_database::CertDatabaseServiceFactory::GetForBrowserContext( |
+ web_ui()->GetWebContents()->GetBrowserContext()); |
chromeos::onc::CertificateImporterImpl cert_importer( |
- BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), nssdb); |
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), |
+ cert_service->GetIOPart()); |
cert_importer.ImportCertificates( |
certificates, |
onc_source, |
@@ -1216,22 +1218,6 @@ void NetInternalsMessageHandler::OnCertificatesImported( |
SendJavascriptCommand("receivedONCFileParse", new base::StringValue(error)); |
} |
-void NetInternalsMessageHandler::OnImportONCFile( |
- const base::ListValue* list) { |
- std::string onc_blob; |
- std::string passcode; |
- if (list->GetSize() != 2 || |
- !list->GetString(0, &onc_blob) || |
- !list->GetString(1, &passcode)) { |
- NOTREACHED(); |
- } |
- |
- GetNSSCertDatabaseForProfile( |
- Profile::FromWebUI(web_ui()), |
- base::Bind(&NetInternalsMessageHandler::ImportONCFileToNSSDB, AsWeakPtr(), |
- onc_blob, passcode)); |
-} |
- |
void NetInternalsMessageHandler::OnStoreDebugLogs(const base::ListValue* list) { |
DCHECK(list); |