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