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 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1074 const ListValue* list) { | 1074 const ListValue* list) { |
1075 // |value| should be: [<URL to test>]. | 1075 // |value| should be: [<URL to test>]. |
1076 string16 url_str; | 1076 string16 url_str; |
1077 CHECK(list->GetString(0, &url_str)); | 1077 CHECK(list->GetString(0, &url_str)); |
1078 | 1078 |
1079 // Try to fix-up the user provided URL into something valid. | 1079 // Try to fix-up the user provided URL into something valid. |
1080 // For example, turn "www.google.com" into "http://www.google.com". | 1080 // For example, turn "www.google.com" into "http://www.google.com". |
1081 GURL url(URLFixerUpper::FixupURL(UTF16ToUTF8(url_str), std::string())); | 1081 GURL url(URLFixerUpper::FixupURL(UTF16ToUTF8(url_str), std::string())); |
1082 | 1082 |
1083 connection_tester_.reset(new ConnectionTester( | 1083 connection_tester_.reset(new ConnectionTester( |
1084 this, io_thread_->globals()->proxy_script_fetcher_context.get())); | 1084 this, |
| 1085 io_thread_->globals()->proxy_script_fetcher_context.get(), |
| 1086 net_log())); |
1085 connection_tester_->RunAllTests(url); | 1087 connection_tester_->RunAllTests(url); |
1086 } | 1088 } |
1087 | 1089 |
1088 void SPKIHashesToString(const net::FingerprintVector& hashes, | 1090 void SPKIHashesToString(const net::FingerprintVector& hashes, |
1089 std::string* string) { | 1091 std::string* string) { |
1090 for (net::FingerprintVector::const_iterator | 1092 for (net::FingerprintVector::const_iterator |
1091 i = hashes.begin(); i != hashes.end(); ++i) { | 1093 i = hashes.begin(); i != hashes.end(); ++i) { |
1092 base::StringPiece hash_str(reinterpret_cast<const char*>(i->data), | 1094 base::StringPiece hash_str(reinterpret_cast<const char*>(i->data), |
1093 arraysize(i->data)); | 1095 arraysize(i->data)); |
1094 std::string encoded; | 1096 std::string encoded; |
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1743 } | 1745 } |
1744 | 1746 |
1745 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) | 1747 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) |
1746 : WebUIController(web_ui) { | 1748 : WebUIController(web_ui) { |
1747 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); | 1749 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); |
1748 | 1750 |
1749 // Set up the chrome://net-internals/ source. | 1751 // Set up the chrome://net-internals/ source. |
1750 Profile* profile = Profile::FromWebUI(web_ui); | 1752 Profile* profile = Profile::FromWebUI(web_ui); |
1751 ChromeURLDataManager::AddDataSource(profile, CreateNetInternalsHTMLSource()); | 1753 ChromeURLDataManager::AddDataSource(profile, CreateNetInternalsHTMLSource()); |
1752 } | 1754 } |
OLD | NEW |