| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "components/payments/content/origin_security_checker.h" | 5 #include "components/payments/content/origin_security_checker.h" |
| 6 | 6 |
| 7 #include "content/public/common/origin_util.h" | 7 #include "content/public/common/origin_util.h" |
| 8 #include "net/base/url_util.h" | 8 #include "net/base/url_util.h" |
| 9 #include "url/gurl.h" | 9 #include "url/gurl.h" |
| 10 | 10 |
| 11 namespace payments { | 11 namespace payments { |
| 12 | 12 |
| 13 // static | 13 // static |
| 14 bool OriginSecurityChecker::IsOriginSecure(const GURL& url) { | 14 bool OriginSecurityChecker::IsOriginSecure(const GURL& url) { |
| 15 return url.is_valid() && content::IsOriginSecure(url); | 15 return url.is_valid() && content::IsOriginSecure(url); |
| 16 } | 16 } |
| 17 | 17 |
| 18 // static | 18 // static |
| 19 bool OriginSecurityChecker::IsSchemeCryptographic(const GURL& url) { | 19 bool OriginSecurityChecker::IsSchemeCryptographic(const GURL& url) { |
| 20 return url.is_valid() && url.SchemeIsCryptographic(); | 20 return url.is_valid() && url.SchemeIsCryptographic(); |
| 21 } | 21 } |
| 22 | 22 |
| 23 // static | 23 // static |
| 24 bool OriginSecurityChecker::IsOriginLocalhostOrFile(const GURL& url) { | 24 bool OriginSecurityChecker::IsOriginLocalhostOrFile(const GURL& url) { |
| 25 return url.is_valid() && | 25 return url.is_valid() && |
| 26 (net::IsLocalhost(url.HostNoBrackets()) || url.SchemeIsFile()); | 26 (net::IsLocalhost(url.HostNoBracketsPiece()) || url.SchemeIsFile()); |
| 27 } | 27 } |
| 28 | 28 |
| 29 } // namespace payments | 29 } // namespace payments |
| OLD | NEW |