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 #include "components/payments/content/payment_details_validation.h" | 5 #include "components/payments/content/payment_details_validation.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "components/payments/content/payment_request.mojom.h" | |
11 #include "components/payments/content/payments_validators.h" | 10 #include "components/payments/content/payments_validators.h" |
| 11 #include "components/payments/mojom/payment_request.mojom.h" |
12 | 12 |
13 namespace payments { | 13 namespace payments { |
14 namespace { | 14 namespace { |
15 | 15 |
16 // Validates ShippingOption or PaymentItem, which happen to have identical | 16 // Validates ShippingOption or PaymentItem, which happen to have identical |
17 // fields, except for "id", which is present only in ShippingOption. | 17 // fields, except for "id", which is present only in ShippingOption. |
18 template <typename T> | 18 template <typename T> |
19 bool validateShippingOptionOrPaymentItem( | 19 bool validateShippingOptionOrPaymentItem( |
20 const T& item, | 20 const T& item, |
21 const payments::mojom::PaymentItemPtr& total, | 21 const payments::mojom::PaymentItemPtr& total, |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 if (!validatePaymentDetailsModifiers(details->modifiers, details->total, | 169 if (!validatePaymentDetailsModifiers(details->modifiers, details->total, |
170 error_message)) | 170 error_message)) |
171 return false; | 171 return false; |
172 } | 172 } |
173 if (!PaymentsValidators::isValidErrorMsgFormat(details->error, error_message)) | 173 if (!PaymentsValidators::isValidErrorMsgFormat(details->error, error_message)) |
174 return false; | 174 return false; |
175 return true; | 175 return true; |
176 } | 176 } |
177 | 177 |
178 } // namespace payments | 178 } // namespace payments |
OLD | NEW |