OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_ui.h" | 5 #include "chrome/browser/ui/webui/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 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1290 std::string onc_blob; | 1290 std::string onc_blob; |
1291 std::string passcode; | 1291 std::string passcode; |
1292 if (list->GetSize() != 2 || | 1292 if (list->GetSize() != 2 || |
1293 !list->GetString(0, &onc_blob) || | 1293 !list->GetString(0, &onc_blob) || |
1294 !list->GetString(1, &passcode)) { | 1294 !list->GetString(1, &passcode)) { |
1295 NOTREACHED(); | 1295 NOTREACHED(); |
1296 } | 1296 } |
1297 | 1297 |
1298 std::string error; | 1298 std::string error; |
1299 chromeos::CrosLibrary::Get()->GetNetworkLibrary()-> | 1299 chromeos::CrosLibrary::Get()->GetNetworkLibrary()-> |
1300 LoadOncNetworks(onc_blob, passcode, &error); | 1300 LoadOncNetworks(onc_blob, passcode, |
| 1301 chromeos::NetworkUIData::ONC_SOURCE_USER_IMPORT, &error); |
1301 SendJavascriptCommand("receivedONCFileParse", | 1302 SendJavascriptCommand("receivedONCFileParse", |
1302 Value::CreateStringValue(error)); | 1303 Value::CreateStringValue(error)); |
1303 } | 1304 } |
1304 #endif | 1305 #endif |
1305 | 1306 |
1306 void NetInternalsMessageHandler::IOThreadImpl::OnSetLogLevel( | 1307 void NetInternalsMessageHandler::IOThreadImpl::OnSetLogLevel( |
1307 const ListValue* list) { | 1308 const ListValue* list) { |
1308 int log_level; | 1309 int log_level; |
1309 std::string log_level_string; | 1310 std::string log_level_string; |
1310 if (!list->GetString(0, &log_level_string) || | 1311 if (!list->GetString(0, &log_level_string) || |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1573 return constants_dict; | 1574 return constants_dict; |
1574 } | 1575 } |
1575 | 1576 |
1576 NetInternalsUI::NetInternalsUI(TabContents* contents) : ChromeWebUI(contents) { | 1577 NetInternalsUI::NetInternalsUI(TabContents* contents) : ChromeWebUI(contents) { |
1577 AddMessageHandler((new NetInternalsMessageHandler())->Attach(this)); | 1578 AddMessageHandler((new NetInternalsMessageHandler())->Attach(this)); |
1578 | 1579 |
1579 // Set up the chrome://net-internals/ source. | 1580 // Set up the chrome://net-internals/ source. |
1580 GetProfile()->GetChromeURLDataManager()->AddDataSource( | 1581 GetProfile()->GetChromeURLDataManager()->AddDataSource( |
1581 CreateNetInternalsHTMLSource()); | 1582 CreateNetInternalsHTMLSource()); |
1582 } | 1583 } |
OLD | NEW |