| 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 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 826 | 826 |
| 827 base::Time expiry = base::Time::Now() + base::TimeDelta::FromDays(1000); | 827 base::Time expiry = base::Time::Now() + base::TimeDelta::FromDays(1000); |
| 828 net::HashValueVector hashes; | 828 net::HashValueVector hashes; |
| 829 if (!hashes_str.empty()) { | 829 if (!hashes_str.empty()) { |
| 830 if (!Base64StringToHashes(hashes_str, &hashes)) | 830 if (!Base64StringToHashes(hashes_str, &hashes)) |
| 831 return; | 831 return; |
| 832 } | 832 } |
| 833 | 833 |
| 834 transport_security_state->AddHSTS(domain, expiry, sts_include_subdomains); | 834 transport_security_state->AddHSTS(domain, expiry, sts_include_subdomains); |
| 835 transport_security_state->AddHPKP(domain, expiry, pkp_include_subdomains, | 835 transport_security_state->AddHPKP(domain, expiry, pkp_include_subdomains, |
| 836 hashes); | 836 hashes, GURL()); |
| 837 } | 837 } |
| 838 | 838 |
| 839 void NetInternalsMessageHandler::IOThreadImpl::OnHSTSDelete( | 839 void NetInternalsMessageHandler::IOThreadImpl::OnHSTSDelete( |
| 840 const base::ListValue* list) { | 840 const base::ListValue* list) { |
| 841 // |list| should be: [<domain to query>]. | 841 // |list| should be: [<domain to query>]. |
| 842 std::string domain; | 842 std::string domain; |
| 843 CHECK(list->GetString(0, &domain)); | 843 CHECK(list->GetString(0, &domain)); |
| 844 if (!base::IsStringASCII(domain)) { | 844 if (!base::IsStringASCII(domain)) { |
| 845 // There cannot be a unicode entry in the HSTS set. | 845 // There cannot be a unicode entry in the HSTS set. |
| 846 return; | 846 return; |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1196 } | 1196 } |
| 1197 | 1197 |
| 1198 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) | 1198 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) |
| 1199 : WebUIController(web_ui) { | 1199 : WebUIController(web_ui) { |
| 1200 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); | 1200 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); |
| 1201 | 1201 |
| 1202 // Set up the chrome://net-internals/ source. | 1202 // Set up the chrome://net-internals/ source. |
| 1203 Profile* profile = Profile::FromWebUI(web_ui); | 1203 Profile* profile = Profile::FromWebUI(web_ui); |
| 1204 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); | 1204 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); |
| 1205 } | 1205 } |
| OLD | NEW |