OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef PaymentsValidators_h | 5 #ifndef PaymentsValidators_h |
6 #define PaymentsValidators_h | 6 #define PaymentsValidators_h |
7 | 7 |
8 #include "modules/ModulesExport.h" | 8 #include "modules/ModulesExport.h" |
9 #include "public/platform/modules/payments/payment_request.mojom-blink.h" | 9 #include "public/platform/modules/payments/payment_request.mojom-blink.h" |
10 #include "wtf/Allocator.h" | 10 #include "wtf/Allocator.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 // Returns true if |code| is a valid ISO 15924 script code. | 32 // Returns true if |code| is a valid ISO 15924 script code. |
33 static bool isValidScriptCodeFormat(const String& code, String* optionalErro
rMessage); | 33 static bool isValidScriptCodeFormat(const String& code, String* optionalErro
rMessage); |
34 | 34 |
35 // Returns true if the payment address is valid: | 35 // Returns true if the payment address is valid: |
36 // - Has a valid region code | 36 // - Has a valid region code |
37 // - Has a valid language code, if any. | 37 // - Has a valid language code, if any. |
38 // - Has a valid script code, if any. | 38 // - Has a valid script code, if any. |
39 // A script code should be present only if language code is present. | 39 // A script code should be present only if language code is present. |
40 static bool isValidShippingAddress(const mojom::blink::PaymentAddressPtr&, S
tring* optionalErrorMessage); | 40 static bool isValidShippingAddress(const mojom::blink::PaymentAddressPtr&, S
tring* optionalErrorMessage); |
| 41 |
| 42 // Returns false if |error| is too long (greater than 2048). |
| 43 static bool isValidErrorMsgFormat(const String& code, String* optionalErrorM
essage); |
41 }; | 44 }; |
42 | 45 |
43 } // namespace blink | 46 } // namespace blink |
44 | 47 |
45 #endif // PaymentsValidators_h | 48 #endif // PaymentsValidators_h |
OLD | NEW |