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 1501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1512 !list->GetString(0, &onc_blob) || | 1512 !list->GetString(0, &onc_blob) || |
1513 !list->GetString(1, &passcode)) { | 1513 !list->GetString(1, &passcode)) { |
1514 NOTREACHED(); | 1514 NOTREACHED(); |
1515 } | 1515 } |
1516 | 1516 |
1517 std::string error; | 1517 std::string error; |
1518 chromeos::NetworkLibrary* cros_network = | 1518 chromeos::NetworkLibrary* cros_network = |
1519 chromeos::CrosLibrary::Get()->GetNetworkLibrary(); | 1519 chromeos::CrosLibrary::Get()->GetNetworkLibrary(); |
1520 if (!cros_network->LoadOncNetworks(onc_blob, passcode, | 1520 if (!cros_network->LoadOncNetworks(onc_blob, passcode, |
1521 chromeos::onc::ONC_SOURCE_USER_IMPORT, | 1521 chromeos::onc::ONC_SOURCE_USER_IMPORT, |
1522 false)) { // allow web trust from policy | 1522 NULL)) { |
1523 error = "Errors occurred during the ONC import."; | 1523 error = "Errors occurred during the ONC import."; |
1524 LOG(ERROR) << error; | 1524 LOG(ERROR) << error; |
1525 } | 1525 } |
1526 | 1526 |
1527 // Now that we've added the networks, we need to rescan them so they'll be | 1527 // Now that we've added the networks, we need to rescan them so they'll be |
1528 // available from the menu more immediately. | 1528 // available from the menu more immediately. |
1529 cros_network->RequestNetworkScan(); | 1529 cros_network->RequestNetworkScan(); |
1530 | 1530 |
1531 SendJavascriptCommand("receivedONCFileParse", | 1531 SendJavascriptCommand("receivedONCFileParse", |
1532 Value::CreateStringValue(error)); | 1532 Value::CreateStringValue(error)); |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1938 } | 1938 } |
1939 | 1939 |
1940 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) | 1940 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) |
1941 : WebUIController(web_ui) { | 1941 : WebUIController(web_ui) { |
1942 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); | 1942 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); |
1943 | 1943 |
1944 // Set up the chrome://net-internals/ source. | 1944 // Set up the chrome://net-internals/ source. |
1945 Profile* profile = Profile::FromWebUI(web_ui); | 1945 Profile* profile = Profile::FromWebUI(web_ui); |
1946 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); | 1946 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); |
1947 } | 1947 } |
OLD | NEW |