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 COMPONENTS_PAYMENTS_PAYMENT_REQUEST_H_ | 5 #ifndef COMPONENTS_PAYMENTS_PAYMENT_REQUEST_H_ |
6 #define COMPONENTS_PAYMENTS_PAYMENT_REQUEST_H_ | 6 #define COMPONENTS_PAYMENTS_PAYMENT_REQUEST_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 void Cancel(); | 50 void Cancel(); |
51 void OnError(); | 51 void OnError(); |
52 | 52 |
53 // Returns the CurrencyFormatter instance for this PaymentRequest. | 53 // Returns the CurrencyFormatter instance for this PaymentRequest. |
54 // |locale_name| should be the result of the browser's GetApplicationLocale(). | 54 // |locale_name| should be the result of the browser's GetApplicationLocale(). |
55 // Note: Having multiple currencies per PaymentRequest is not supported; hence | 55 // Note: Having multiple currencies per PaymentRequest is not supported; hence |
56 // the CurrencyFormatter is cached here. | 56 // the CurrencyFormatter is cached here. |
57 CurrencyFormatter* GetOrCreateCurrencyFormatter( | 57 CurrencyFormatter* GetOrCreateCurrencyFormatter( |
58 const std::string& currency_code, | 58 const std::string& currency_code, |
59 const base::Optional<std::string> currency_system, | 59 const std::string& currency_system, |
60 const std::string& locale_name); | 60 const std::string& locale_name); |
61 | 61 |
62 // Returns the Autofill Profile, representing the shipping address and contact | 62 // Returns the Autofill Profile, representing the shipping address and contact |
63 // information, currently selected for this PaymentRequest flow. If | 63 // information, currently selected for this PaymentRequest flow. If |
64 // unpopulated, populates with and returns the 0th profile on record for this | 64 // unpopulated, populates with and returns the 0th profile on record for this |
65 // user, if it exists; or nullptr otherwise. Profile is owned by the request | 65 // user, if it exists; or nullptr otherwise. Profile is owned by the request |
66 // object, not the caller. | 66 // object, not the caller. |
67 autofill::AutofillProfile* GetCurrentlySelectedProfile(); | 67 autofill::AutofillProfile* GetCurrentlySelectedProfile(); |
68 | 68 |
69 // Returns the currently selected credit card for this PaymentRequest flow. | 69 // Returns the currently selected credit card for this PaymentRequest flow. |
(...skipping 14 matching lines...) Expand all Loading... |
84 payments::mojom::PaymentDetailsPtr details_; | 84 payments::mojom::PaymentDetailsPtr details_; |
85 std::unique_ptr<CurrencyFormatter> currency_formatter_; | 85 std::unique_ptr<CurrencyFormatter> currency_formatter_; |
86 std::unique_ptr<autofill::AutofillProfile> profile_; | 86 std::unique_ptr<autofill::AutofillProfile> profile_; |
87 | 87 |
88 DISALLOW_COPY_AND_ASSIGN(PaymentRequest); | 88 DISALLOW_COPY_AND_ASSIGN(PaymentRequest); |
89 }; | 89 }; |
90 | 90 |
91 } // namespace payments | 91 } // namespace payments |
92 | 92 |
93 #endif // COMPONENTS_PAYMENTS_PAYMENT_REQUEST_H_ | 93 #endif // COMPONENTS_PAYMENTS_PAYMENT_REQUEST_H_ |
OLD | NEW |