Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(695)

Unified Diff: components/payments/content/origin_security_checker.cc

Issue 2815763002: Prevent usage of web payments API over insecure HTTPS. (Closed)
Patch Set: Fix typo Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/payments/content/origin_security_checker.cc
diff --git a/components/payments/content/origin_security_checker.cc b/components/payments/content/origin_security_checker.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5cede98ca114cd9f025877949892d9c1a9a96c03
--- /dev/null
+++ b/components/payments/content/origin_security_checker.cc
@@ -0,0 +1,22 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/payments/content/origin_security_checker.h"
+
+#include "content/public/common/origin_util.h"
+#include "url/gurl.h"
+
+namespace payments {
+
+// static
+bool OriginSecurityChecker::IsOriginSecure(const GURL& url) {
+ return url.is_valid() && content::IsOriginSecure(url);
+}
+
+// static
+bool OriginSecurityChecker::IsSchemeCryptographic(const GURL& url) {
+ return url.is_valid() && url.SchemeIsCryptographic();
+}
+
+} // namespace payments
« no previous file with comments | « components/payments/content/origin_security_checker.h ('k') | components/payments/content/payment_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698