| 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/payment_request.h" | 5 #include "components/payments/payment_request.h" |
| 6 | 6 |
| 7 #include "components/payments/payment_details_validation.h" | 7 #include "components/payments/payment_details_validation.h" |
| 8 #include "components/payments/payment_request_delegate.h" | 8 #include "components/payments/payment_request_delegate.h" |
| 9 #include "components/payments/payment_request_web_contents_manager.h" | 9 #include "components/payments/payment_request_web_contents_manager.h" |
| 10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 void PaymentRequest::Cancel() { | 55 void PaymentRequest::Cancel() { |
| 56 client_->OnError(payments::mojom::PaymentErrorReason::USER_CANCEL); | 56 client_->OnError(payments::mojom::PaymentErrorReason::USER_CANCEL); |
| 57 } | 57 } |
| 58 | 58 |
| 59 void PaymentRequest::OnError() { | 59 void PaymentRequest::OnError() { |
| 60 binding_.Close(); | 60 binding_.Close(); |
| 61 manager_->DestroyRequest(this); | 61 manager_->DestroyRequest(this); |
| 62 } | 62 } |
| 63 | 63 |
| 64 CurrencyFormatter* PaymentRequest::GetOrCreateCurrencyFormatter( |
| 65 const std::string& currency_code, |
| 66 const base::Optional<std::string> currency_system, |
| 67 const std::string& locale_name) { |
| 68 if (!currency_formatter_) { |
| 69 currency_formatter_.reset(new CurrencyFormatter( |
| 70 currency_code, currency_system, locale_name)); |
| 71 } |
| 72 |
| 73 return currency_formatter_.get(); |
| 74 } |
| 75 |
| 64 } // namespace payments | 76 } // namespace payments |
| OLD | NEW |