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

Unified Diff: third_party/WebKit/Source/modules/payments/PaymentsValidators.h

Issue 1753543002: PaymentRequest Mojo bindings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@interface
Patch Set: haraken@'s + esprehn@'s comments Created 4 years, 9 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: third_party/WebKit/Source/modules/payments/PaymentsValidators.h
diff --git a/third_party/WebKit/Source/modules/payments/PaymentsValidators.h b/third_party/WebKit/Source/modules/payments/PaymentsValidators.h
new file mode 100644
index 0000000000000000000000000000000000000000..7d52f67ce67ee0127e9affb61899a9f5f72bab79
--- /dev/null
+++ b/third_party/WebKit/Source/modules/payments/PaymentsValidators.h
@@ -0,0 +1,36 @@
+// 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.
+
+#ifndef PaymentsValidators_h
+#define PaymentsValidators_h
+
+#include "modules/ModulesExport.h"
+#include "wtf/Allocator.h"
+#include "wtf/text/WTFString.h"
+
+namespace blink {
+
+class MODULES_EXPORT PaymentsValidators final {
+ STATIC_ONLY(PaymentsValidators);
+
+public:
+ // Returns true if |code| is a valid ISO 4217 currency code.
+ static bool isValidCurrencyCodeFormat(const String& code, String* optionalErrorMessage);
+
+ // Returns true if |amount| is a valid currency code as defined in ISO 20022 CurrencyAnd30Amount.
+ static bool isValidAmountFormat(const String& amount, String* optionalErrorMessage);
+
+ // Returns true if |code| is a valid ISO 3166 country code.
+ static bool isValidRegionCodeFormat(const String& code, String* optionalErrorMessage);
+
+ // Returns true if |code| is a valid ISO 639 language code.
+ static bool isValidLanguageCodeFormat(const String& code, String* optionalErrorMessage);
+
+ // Returns true if |code| is a valid ISO 1524 script code.
+ static bool isValidScriptCodeFormat(const String& code, String* optionalErrorMessage);
+};
+
+} // namespace blink
+
+#endif // PaymentsValidators_h

Powered by Google App Engine
This is Rietveld 408576698