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 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1088 if (!base::IsStringASCII(domain)) { | 1088 if (!base::IsStringASCII(domain)) { |
1089 result->SetString("error", "non-ASCII domain name"); | 1089 result->SetString("error", "non-ASCII domain name"); |
1090 } else { | 1090 } else { |
1091 net::TransportSecurityState* transport_security_state = | 1091 net::TransportSecurityState* transport_security_state = |
1092 GetMainContext()->transport_security_state(); | 1092 GetMainContext()->transport_security_state(); |
1093 if (!transport_security_state) { | 1093 if (!transport_security_state) { |
1094 result->SetString("error", "no TransportSecurityState active"); | 1094 result->SetString("error", "no TransportSecurityState active"); |
1095 } else { | 1095 } else { |
1096 net::TransportSecurityState::DomainState static_state; | 1096 net::TransportSecurityState::DomainState static_state; |
1097 const bool found_static = transport_security_state->GetStaticDomainState( | 1097 const bool found_static = transport_security_state->GetStaticDomainState( |
1098 domain, true, &static_state); | 1098 domain, &static_state); |
1099 if (found_static) { | 1099 if (found_static) { |
1100 result->SetBoolean("has_static_sts", | 1100 result->SetBoolean("has_static_sts", |
1101 found_static && static_state.ShouldUpgradeToSSL()); | 1101 found_static && static_state.ShouldUpgradeToSSL()); |
1102 result->SetInteger("static_upgrade_mode", | 1102 result->SetInteger("static_upgrade_mode", |
1103 static_cast<int>(static_state.sts.upgrade_mode)); | 1103 static_cast<int>(static_state.sts.upgrade_mode)); |
1104 result->SetBoolean("static_sts_include_subdomains", | 1104 result->SetBoolean("static_sts_include_subdomains", |
1105 static_state.sts.include_subdomains); | 1105 static_state.sts.include_subdomains); |
1106 result->SetDouble("static_sts_observed", | 1106 result->SetDouble("static_sts_observed", |
1107 static_state.sts.last_observed.ToDoubleT()); | 1107 static_state.sts.last_observed.ToDoubleT()); |
1108 result->SetDouble("static_sts_expiry", | 1108 result->SetDouble("static_sts_expiry", |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1730 } | 1730 } |
1731 | 1731 |
1732 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) | 1732 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) |
1733 : WebUIController(web_ui) { | 1733 : WebUIController(web_ui) { |
1734 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); | 1734 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); |
1735 | 1735 |
1736 // Set up the chrome://net-internals/ source. | 1736 // Set up the chrome://net-internals/ source. |
1737 Profile* profile = Profile::FromWebUI(web_ui); | 1737 Profile* profile = Profile::FromWebUI(web_ui); |
1738 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); | 1738 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); |
1739 } | 1739 } |
OLD | NEW |