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

Side by Side Diff: chrome/browser/ui/webui/net_internals/net_internals_ui.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 unified diff | Download patch | Annotate | Revision Log
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/ui/webui/net_internals/net_internals_ui.h" 5 #include "chrome/browser/ui/webui/net_internals/net_internals_ui.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <list> 8 #include <list>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 #include "net/proxy/proxy_service.h" 69 #include "net/proxy/proxy_service.h"
70 #include "net/url_request/url_request_context.h" 70 #include "net/url_request/url_request_context.h"
71 #include "net/url_request/url_request_context_getter.h" 71 #include "net/url_request/url_request_context_getter.h"
72 72
73 #if defined(OS_CHROMEOS) 73 #if defined(OS_CHROMEOS)
74 #include "chrome/browser/chromeos/file_manager/filesystem_api_util.h" 74 #include "chrome/browser/chromeos/file_manager/filesystem_api_util.h"
75 #include "chrome/browser/chromeos/net/onc_utils.h" 75 #include "chrome/browser/chromeos/net/onc_utils.h"
76 #include "chrome/browser/chromeos/profiles/profile_helper.h" 76 #include "chrome/browser/chromeos/profiles/profile_helper.h"
77 #include "chrome/browser/chromeos/system/syslogs_provider.h" 77 #include "chrome/browser/chromeos/system/syslogs_provider.h"
78 #include "chrome/browser/chromeos/system_logs/debug_log_writer.h" 78 #include "chrome/browser/chromeos/system_logs/debug_log_writer.h"
79 #include "chrome/browser/net/nss_context.h"
80 #include "chromeos/dbus/dbus_thread_manager.h" 79 #include "chromeos/dbus/dbus_thread_manager.h"
81 #include "chromeos/dbus/debug_daemon_client.h" 80 #include "chromeos/dbus/debug_daemon_client.h"
82 #include "chromeos/network/onc/onc_certificate_importer_impl.h" 81 #include "chromeos/network/onc/onc_certificate_importer_impl.h"
83 #include "chromeos/network/onc/onc_utils.h" 82 #include "chromeos/network/onc/onc_utils.h"
84 #include "components/user_manager/user.h" 83 #include "components/user_manager/user.h"
85 #endif 84 #endif
86 85
87 #if defined(OS_WIN) 86 #if defined(OS_WIN)
88 #include "chrome/browser/net/service_providers_win.h" 87 #include "chrome/browser/net/service_providers_win.h"
89 #endif 88 #endif
(...skipping 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after
1437 } else { 1436 } else {
1438 error = "User not found."; 1437 error = "User not found.";
1439 } 1438 }
1440 1439
1441 LOG_IF(ERROR, !error.empty()) << error; 1440 LOG_IF(ERROR, !error.empty()) << error;
1442 SendJavascriptCommand("receivedONCFileParse", new base::StringValue(error)); 1441 SendJavascriptCommand("receivedONCFileParse", new base::StringValue(error));
1443 } 1442 }
1444 1443
1445 void NetInternalsMessageHandler::OnImportONCFile( 1444 void NetInternalsMessageHandler::OnImportONCFile(
1446 const base::ListValue* list) { 1445 const base::ListValue* list) {
1447 std::string onc_blob; 1446 /*
1448 std::string passcode; 1447 std::string onc_blob;
1449 if (list->GetSize() != 2 || 1448 std::string passcode;
1450 !list->GetString(0, &onc_blob) || 1449 if (list->GetSize() != 2 ||
1451 !list->GetString(1, &passcode)) { 1450 !list->GetString(0, &onc_blob) ||
1452 NOTREACHED(); 1451 !list->GetString(1, &passcode)) {
1453 } 1452 NOTREACHED();
1453 }
1454 1454
1455 GetNSSCertDatabaseForProfile( 1455 GetNSSCertDatabaseForProfile(
1456 Profile::FromWebUI(web_ui()), 1456 Profile::FromWebUI(web_ui()),
1457 base::Bind(&NetInternalsMessageHandler::ImportONCFileToNSSDB, AsWeakPtr(), 1457 base::Bind(&NetInternalsMessageHandler::ImportONCFileToNSSDB,
1458 onc_blob, passcode)); 1458 AsWeakPtr(),
1459 onc_blob, passcode));
1460 */
1459 } 1461 }
1460 1462
1461 void NetInternalsMessageHandler::OnStoreDebugLogs(const base::ListValue* list) { 1463 void NetInternalsMessageHandler::OnStoreDebugLogs(const base::ListValue* list) {
1462 DCHECK(list); 1464 DCHECK(list);
1463 1465
1464 SendJavascriptCommand("receivedStoreDebugLogs", 1466 SendJavascriptCommand("receivedStoreDebugLogs",
1465 new base::StringValue("Creating log file...")); 1467 new base::StringValue("Creating log file..."));
1466 Profile* profile = Profile::FromWebUI(web_ui()); 1468 Profile* profile = Profile::FromWebUI(web_ui());
1467 const DownloadPrefs* const prefs = DownloadPrefs::FromBrowserContext(profile); 1469 const DownloadPrefs* const prefs = DownloadPrefs::FromBrowserContext(profile);
1468 base::FilePath path = prefs->DownloadPath(); 1470 base::FilePath path = prefs->DownloadPath();
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
1709 } 1711 }
1710 1712
1711 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) 1713 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui)
1712 : WebUIController(web_ui) { 1714 : WebUIController(web_ui) {
1713 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); 1715 web_ui->AddMessageHandler(new NetInternalsMessageHandler());
1714 1716
1715 // Set up the chrome://net-internals/ source. 1717 // Set up the chrome://net-internals/ source.
1716 Profile* profile = Profile::FromWebUI(web_ui); 1718 Profile* profile = Profile::FromWebUI(web_ui);
1717 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); 1719 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource());
1718 } 1720 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698