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 1242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1253 if (!IsStringASCII(domain)) { | 1253 if (!IsStringASCII(domain)) { |
1254 result->SetString("error", "non-ASCII domain name"); | 1254 result->SetString("error", "non-ASCII domain name"); |
1255 } else { | 1255 } else { |
1256 net::TransportSecurityState* transport_security_state = | 1256 net::TransportSecurityState* transport_security_state = |
1257 GetMainContext()->transport_security_state(); | 1257 GetMainContext()->transport_security_state(); |
1258 if (!transport_security_state) { | 1258 if (!transport_security_state) { |
1259 result->SetString("error", "no TransportSecurityState active"); | 1259 result->SetString("error", "no TransportSecurityState active"); |
1260 } else { | 1260 } else { |
1261 net::TransportSecurityState::DomainState state; | 1261 net::TransportSecurityState::DomainState state; |
1262 const bool found = transport_security_state->GetDomainState( | 1262 const bool found = transport_security_state->GetDomainState( |
1263 domain, true, true, &state); | 1263 domain, true, &state); |
1264 | 1264 |
1265 result->SetBoolean("result", found); | 1265 result->SetBoolean("result", found); |
1266 if (found) { | 1266 if (found) { |
1267 result->SetInteger("mode", static_cast<int>(state.upgrade_mode)); | 1267 result->SetInteger("mode", static_cast<int>(state.upgrade_mode)); |
1268 result->SetBoolean("sts_subdomains", state.sts_include_subdomains); | 1268 result->SetBoolean("sts_subdomains", state.sts_include_subdomains); |
1269 result->SetBoolean("pkp_subdomains", state.pkp_include_subdomains); | 1269 result->SetBoolean("pkp_subdomains", state.pkp_include_subdomains); |
1270 result->SetString("domain", state.domain); | 1270 result->SetString("domain", state.domain); |
1271 result->SetDouble("expiry", state.upgrade_expiry.ToDoubleT()); | 1271 result->SetDouble("expiry", state.upgrade_expiry.ToDoubleT()); |
1272 result->SetDouble("dynamic_spki_hashes_expiry", | 1272 result->SetDouble("dynamic_spki_hashes_expiry", |
1273 state.dynamic_spki_hashes_expiry.ToDoubleT()); | 1273 state.dynamic_spki_hashes_expiry.ToDoubleT()); |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1871 } | 1871 } |
1872 | 1872 |
1873 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) | 1873 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) |
1874 : WebUIController(web_ui) { | 1874 : WebUIController(web_ui) { |
1875 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); | 1875 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); |
1876 | 1876 |
1877 // Set up the chrome://net-internals/ source. | 1877 // Set up the chrome://net-internals/ source. |
1878 Profile* profile = Profile::FromWebUI(web_ui); | 1878 Profile* profile = Profile::FromWebUI(web_ui); |
1879 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); | 1879 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); |
1880 } | 1880 } |
OLD | NEW |