OLD | NEW |
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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 #include "net/proxy/proxy_service.h" | 75 #include "net/proxy/proxy_service.h" |
76 #include "net/url_request/url_request_context.h" | 76 #include "net/url_request/url_request_context.h" |
77 #include "net/url_request/url_request_context_getter.h" | 77 #include "net/url_request/url_request_context_getter.h" |
78 #include "ui/base/resource/resource_bundle.h" | 78 #include "ui/base/resource/resource_bundle.h" |
79 | 79 |
80 #if defined(OS_CHROMEOS) | 80 #if defined(OS_CHROMEOS) |
81 #include "chrome/browser/chromeos/cros/network_library.h" | 81 #include "chrome/browser/chromeos/cros/network_library.h" |
82 #include "chrome/browser/chromeos/system/syslogs_provider.h" | 82 #include "chrome/browser/chromeos/system/syslogs_provider.h" |
83 #include "chromeos/dbus/dbus_thread_manager.h" | 83 #include "chromeos/dbus/dbus_thread_manager.h" |
84 #include "chromeos/dbus/debug_daemon_client.h" | 84 #include "chromeos/dbus/debug_daemon_client.h" |
85 #include "chromeos/network/certificate_handler.h" | 85 #include "chromeos/network/onc/onc_certificate_importer_impl.h" |
86 #include "chromeos/network/onc/onc_constants.h" | 86 #include "chromeos/network/onc/onc_constants.h" |
87 #include "chromeos/network/onc/onc_utils.h" | 87 #include "chromeos/network/onc/onc_utils.h" |
88 #endif | 88 #endif |
89 #if defined(OS_WIN) | 89 #if defined(OS_WIN) |
90 #include "chrome/browser/net/service_providers_win.h" | 90 #include "chrome/browser/net/service_providers_win.h" |
91 #endif | 91 #endif |
92 | 92 |
93 using base::PassPlatformFile; | 93 using base::PassPlatformFile; |
94 using base::PlatformFile; | 94 using base::PlatformFile; |
95 using base::PlatformFileError; | 95 using base::PlatformFileError; |
(...skipping 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1548 | 1548 |
1549 base::ListValue network_configs; | 1549 base::ListValue network_configs; |
1550 base::ListValue certificates; | 1550 base::ListValue certificates; |
1551 std::string error; | 1551 std::string error; |
1552 if (!chromeos::onc::ParseAndValidateOncForImport( | 1552 if (!chromeos::onc::ParseAndValidateOncForImport( |
1553 onc_blob, onc_source, passcode, &network_configs, &certificates)) { | 1553 onc_blob, onc_source, passcode, &network_configs, &certificates)) { |
1554 error = "Errors occurred during the ONC parsing. "; | 1554 error = "Errors occurred during the ONC parsing. "; |
1555 LOG(ERROR) << error; | 1555 LOG(ERROR) << error; |
1556 } | 1556 } |
1557 | 1557 |
1558 chromeos::CertificateHandler certificate_handler; | 1558 chromeos::onc::CertificateImporterImpl cert_importer; |
1559 if (!certificate_handler.ImportCertificates(certificates, onc_source, NULL)) { | 1559 if (!cert_importer.ImportCertificates(certificates, onc_source, NULL)) { |
1560 error += "Some certificates couldn't be imported. "; | 1560 error += "Some certificates couldn't be imported. "; |
1561 LOG(ERROR) << error; | 1561 LOG(ERROR) << error; |
1562 } | 1562 } |
1563 | 1563 |
1564 chromeos::NetworkLibrary* network_library = | 1564 chromeos::NetworkLibrary* network_library = |
1565 chromeos::NetworkLibrary::Get(); | 1565 chromeos::NetworkLibrary::Get(); |
1566 network_library->LoadOncNetworks(network_configs, onc_source); | 1566 network_library->LoadOncNetworks(network_configs, onc_source); |
1567 | 1567 |
1568 // Now that we've added the networks, we need to rescan them so they'll be | 1568 // Now that we've added the networks, we need to rescan them so they'll be |
1569 // available from the menu more immediately. | 1569 // available from the menu more immediately. |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1868 } | 1868 } |
1869 | 1869 |
1870 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) | 1870 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) |
1871 : WebUIController(web_ui) { | 1871 : WebUIController(web_ui) { |
1872 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); | 1872 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); |
1873 | 1873 |
1874 // Set up the chrome://net-internals/ source. | 1874 // Set up the chrome://net-internals/ source. |
1875 Profile* profile = Profile::FromWebUI(web_ui); | 1875 Profile* profile = Profile::FromWebUI(web_ui); |
1876 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); | 1876 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); |
1877 } | 1877 } |
OLD | NEW |