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

Side by Side Diff: chrome/browser/ui/webui/net_internals/net_internals_ui.cc

Issue 11299236: This moves the ONC parsing code into chromeos/network/onc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove translated strings Created 8 years 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 #include "net/base/transport_security_state.h" 63 #include "net/base/transport_security_state.h"
64 #include "net/disk_cache/disk_cache.h" 64 #include "net/disk_cache/disk_cache.h"
65 #include "net/http/http_cache.h" 65 #include "net/http/http_cache.h"
66 #include "net/http/http_network_layer.h" 66 #include "net/http/http_network_layer.h"
67 #include "net/http/http_network_session.h" 67 #include "net/http/http_network_session.h"
68 #include "net/http/http_server_properties.h" 68 #include "net/http/http_server_properties.h"
69 #include "net/http/http_stream_factory.h" 69 #include "net/http/http_stream_factory.h"
70 #include "net/proxy/proxy_service.h" 70 #include "net/proxy/proxy_service.h"
71 #include "net/url_request/url_request_context.h" 71 #include "net/url_request/url_request_context.h"
72 #include "net/url_request/url_request_context_getter.h" 72 #include "net/url_request/url_request_context_getter.h"
73 #include "ui/base/l10n/l10n_util.h"
73 #include "ui/base/resource/resource_bundle.h" 74 #include "ui/base/resource/resource_bundle.h"
74 75
75 #if defined(OS_CHROMEOS) 76 #if defined(OS_CHROMEOS)
76 #include "chrome/browser/chromeos/cros/cros_library.h" 77 #include "chrome/browser/chromeos/cros/cros_library.h"
77 #include "chrome/browser/chromeos/cros/network_library.h" 78 #include "chrome/browser/chromeos/cros/network_library.h"
78 #include "chrome/browser/chromeos/system/syslogs_provider.h" 79 #include "chrome/browser/chromeos/system/syslogs_provider.h"
79 #include "chromeos/dbus/dbus_thread_manager.h" 80 #include "chromeos/dbus/dbus_thread_manager.h"
80 #include "chromeos/dbus/debug_daemon_client.h" 81 #include "chromeos/dbus/debug_daemon_client.h"
82 #include "chromeos/network/onc/onc_constants.h"
81 #endif 83 #endif
82 #if defined(OS_WIN) 84 #if defined(OS_WIN)
83 #include "chrome/browser/net/service_providers_win.h" 85 #include "chrome/browser/net/service_providers_win.h"
84 #endif 86 #endif
85 87
86 using base::PassPlatformFile; 88 using base::PassPlatformFile;
87 using base::PlatformFile; 89 using base::PlatformFile;
88 using base::PlatformFileError; 90 using base::PlatformFileError;
89 using content::BrowserThread; 91 using content::BrowserThread;
90 using content::WebContents; 92 using content::WebContents;
(...skipping 1390 matching lines...) Expand 10 before | Expand all | Expand 10 after
1481 void NetInternalsMessageHandler::OnImportONCFile(const ListValue* list) { 1483 void NetInternalsMessageHandler::OnImportONCFile(const ListValue* list) {
1482 std::string onc_blob; 1484 std::string onc_blob;
1483 std::string passcode; 1485 std::string passcode;
1484 if (list->GetSize() != 2 || 1486 if (list->GetSize() != 2 ||
1485 !list->GetString(0, &onc_blob) || 1487 !list->GetString(0, &onc_blob) ||
1486 !list->GetString(1, &passcode)) { 1488 !list->GetString(1, &passcode)) {
1487 NOTREACHED(); 1489 NOTREACHED();
1488 } 1490 }
1489 1491
1490 std::string error; 1492 std::string error;
1493 std::string log_error;
1491 chromeos::NetworkLibrary* cros_network = 1494 chromeos::NetworkLibrary* cros_network =
1492 chromeos::CrosLibrary::Get()->GetNetworkLibrary(); 1495 chromeos::CrosLibrary::Get()->GetNetworkLibrary();
1493 cros_network->LoadOncNetworks(onc_blob, passcode, 1496 if (!cros_network->LoadOncNetworks(onc_blob, passcode,
pneubeck (no reviews) 2012/12/04 10:43:56 We should also forwards warnings in the case of Lo
Greg Spencer (Chromium) 2012/12/07 18:12:27 Logging now goes to network logging interface, inc
1494 chromeos::NetworkUIData::ONC_SOURCE_USER_IMPORT, 1497 chromeos::onc::ONC_SOURCE_USER_IMPORT,
1495 false, // allow_web_trust_from_policy 1498 false, // allow_web_trust_from_policy
1496 &error); 1499 &log_error)) {
1500 LOG(ERROR) << "Unable to load ONC blob: " << log_error;
pneubeck (no reviews) 2012/12/04 10:43:56 no need to log |log_error|...
Greg Spencer (Chromium) 2012/12/07 18:12:27 Done.
1501 error = l10n_util::GetStringUTF8(
1502 IDS_NETWORK_CONFIG_ERROR_UNABLE_TO_LOAD_ONC);
pneubeck (no reviews) 2012/12/04 10:43:56 Actually, l10n isn't needed for net-internals. Non
Greg Spencer (Chromium) 2012/12/07 18:12:27 Done.
1503 }
1497 1504
1498 // Now that we've added the networks, we need to rescan them so they'll be 1505 // Now that we've added the networks, we need to rescan them so they'll be
1499 // available from the menu more immediately. 1506 // available from the menu more immediately.
1500 cros_network->RequestNetworkScan(); 1507 cros_network->RequestNetworkScan();
1501 1508
1502 SendJavascriptCommand("receivedONCFileParse", 1509 SendJavascriptCommand("receivedONCFileParse",
1503 Value::CreateStringValue(error)); 1510 Value::CreateStringValue(error));
1504 } 1511 }
1505 1512
1506 void NetInternalsMessageHandler::OnStoreDebugLogs(const ListValue* list) { 1513 void NetInternalsMessageHandler::OnStoreDebugLogs(const ListValue* list) {
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
1909 } 1916 }
1910 1917
1911 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) 1918 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui)
1912 : WebUIController(web_ui) { 1919 : WebUIController(web_ui) {
1913 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); 1920 web_ui->AddMessageHandler(new NetInternalsMessageHandler());
1914 1921
1915 // Set up the chrome://net-internals/ source. 1922 // Set up the chrome://net-internals/ source.
1916 Profile* profile = Profile::FromWebUI(web_ui); 1923 Profile* profile = Profile::FromWebUI(web_ui);
1917 ChromeURLDataManager::AddDataSource(profile, CreateNetInternalsHTMLSource()); 1924 ChromeURLDataManager::AddDataSource(profile, CreateNetInternalsHTMLSource());
1918 } 1925 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698