Index: third_party/WebKit/Source/modules/payments/HTMLIFrameElementPayments.cpp |
diff --git a/third_party/WebKit/Source/modules/payments/HTMLIFrameElementPayments.cpp b/third_party/WebKit/Source/modules/payments/HTMLIFrameElementPayments.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6ce4b014a285edca5a6ecd3dc35d15b6d407c7c0 |
--- /dev/null |
+++ b/third_party/WebKit/Source/modules/payments/HTMLIFrameElementPayments.cpp |
@@ -0,0 +1,58 @@ |
+// Copyright 2016 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 "modules/payments/HTMLIFrameElementPayments.h" |
+ |
+#include "core/dom/QualifiedName.h" |
+#include "core/html/HTMLIFrameElement.h" |
+ |
+namespace blink { |
+ |
+HTMLIFrameElementPayments::HTMLIFrameElementPayments() {} |
+ |
+// static |
+const char* HTMLIFrameElementPayments::supplementName() { |
+ return "HTMLIFrameElementPayments"; |
+} |
+ |
+// static |
+bool HTMLIFrameElementPayments::fastHasAttribute( |
+ const QualifiedName& name, |
+ const HTMLIFrameElement& element) { |
+ DCHECK(name == HTMLNames::allowpaymentrequestAttr); |
+ return element.fastHasAttribute(name); |
+} |
+ |
+// static |
+void HTMLIFrameElementPayments::setBooleanAttribute(const QualifiedName& name, |
+ HTMLIFrameElement& element, |
+ bool value) { |
+ DCHECK(name == HTMLNames::allowpaymentrequestAttr); |
+ element.setBooleanAttribute(name, value); |
+} |
+ |
+// static |
+HTMLIFrameElementPayments& HTMLIFrameElementPayments::from( |
+ HTMLIFrameElement& iframe) { |
+ HTMLIFrameElementPayments* supplement = |
+ static_cast<HTMLIFrameElementPayments*>( |
+ Supplement<HTMLIFrameElement>::from(iframe, supplementName())); |
+ if (!supplement) { |
+ supplement = new HTMLIFrameElementPayments(); |
+ provideTo(iframe, supplementName(), supplement); |
+ } |
+ return *supplement; |
+} |
+ |
+// static |
+bool HTMLIFrameElementPayments::allowPaymentRequest( |
+ HTMLIFrameElement& element) { |
+ return element.fastHasAttribute(HTMLNames::allowpaymentrequestAttr); |
+} |
+ |
+DEFINE_TRACE(HTMLIFrameElementPayments) { |
+ Supplement<HTMLIFrameElement>::trace(visitor); |
+} |
+ |
+} // namespace blink |