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

Side by Side Diff: third_party/WebKit/Source/modules/payments/PaymentsValidators.cpp

Issue 2489943003: Revert of [Web Payments] Mojom namespace blink -> payments (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
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 #include "modules/payments/PaymentsValidators.h" 5 #include "modules/payments/PaymentsValidators.h"
6 6
7 #include "bindings/core/v8/ScriptRegexp.h" 7 #include "bindings/core/v8/ScriptRegexp.h"
8 #include "platform/weborigin/KURL.h" 8 #include "platform/weborigin/KURL.h"
9 #include "wtf/text/StringImpl.h" 9 #include "wtf/text/StringImpl.h"
10 10
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 if (optionalErrorMessage) 94 if (optionalErrorMessage)
95 *optionalErrorMessage = "'" + code + 95 *optionalErrorMessage = "'" + code +
96 "' is not a valid ISO 15924 script code, should be " 96 "' is not a valid ISO 15924 script code, should be "
97 "an upper case letter [A-Z] followed by 3 lower " 97 "an upper case letter [A-Z] followed by 3 lower "
98 "case letters [a-z]"; 98 "case letters [a-z]";
99 99
100 return false; 100 return false;
101 } 101 }
102 102
103 bool PaymentsValidators::isValidShippingAddress( 103 bool PaymentsValidators::isValidShippingAddress(
104 const payments::mojom::blink::PaymentAddressPtr& address, 104 const mojom::blink::PaymentAddressPtr& address,
105 String* optionalErrorMessage) { 105 String* optionalErrorMessage) {
106 if (!isValidCountryCodeFormat(address->country, optionalErrorMessage)) 106 if (!isValidCountryCodeFormat(address->country, optionalErrorMessage))
107 return false; 107 return false;
108 108
109 if (!isValidLanguageCodeFormat(address->language_code, optionalErrorMessage)) 109 if (!isValidLanguageCodeFormat(address->language_code, optionalErrorMessage))
110 return false; 110 return false;
111 111
112 if (!isValidScriptCodeFormat(address->script_code, optionalErrorMessage)) 112 if (!isValidScriptCodeFormat(address->script_code, optionalErrorMessage))
113 return false; 113 return false;
114 114
(...skipping 14 matching lines...) Expand all
129 return true; 129 return true;
130 130
131 if (optionalErrorMessage) 131 if (optionalErrorMessage)
132 *optionalErrorMessage = 132 *optionalErrorMessage =
133 "Error message should be at most 2048 characters long"; 133 "Error message should be at most 2048 characters long";
134 134
135 return false; 135 return false;
136 } 136 }
137 137
138 } // namespace blink 138 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698