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

Side by Side Diff: ios/chrome/browser/payments/payment_request.h

Issue 2878763002: [Payments] Better default selections on iOS (Closed)
Patch Set: fix test, really Created 3 years, 7 months 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_H_ 5 #ifndef IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_H_
6 #define IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_H_ 6 #define IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "components/payments/core/payment_options_provider.h" 14 #include "components/payments/core/payment_options_provider.h"
15 #include "components/payments/core/payments_profile_comparator.h"
15 #include "ios/web/public/payments/payment_request.h" 16 #include "ios/web/public/payments/payment_request.h"
16 17
17 namespace autofill { 18 namespace autofill {
18 class AutofillProfile; 19 class AutofillProfile;
19 class CreditCard; 20 class CreditCard;
20 class PersonalDataManager; 21 class PersonalDataManager;
21 } // namespace autofill 22 } // namespace autofill
22 23
23 namespace payments { 24 namespace payments {
24 class CurrencyFormatter; 25 class CurrencyFormatter;
(...skipping 21 matching lines...) Expand all
46 } 47 }
47 48
48 // Returns the payment details from |web_payment_request_|. 49 // Returns the payment details from |web_payment_request_|.
49 const web::PaymentDetails& payment_details() const { 50 const web::PaymentDetails& payment_details() const {
50 return web_payment_request_.details; 51 return web_payment_request_.details;
51 } 52 }
52 53
53 // Updates the payment details of the |web_payment_request_|. It also updates 54 // Updates the payment details of the |web_payment_request_|. It also updates
54 // the cached references to the shipping options in |web_payment_request_| as 55 // the cached references to the shipping options in |web_payment_request_| as
55 // well as the reference to the selected shipping option. 56 // well as the reference to the selected shipping option.
56 void set_payment_details(const web::PaymentDetails& details); 57 void UpdatePaymentDetails(const web::PaymentDetails& details);
57 58
58 // PaymentOptionsProvider: 59 // PaymentOptionsProvider:
59 bool request_shipping() const override; 60 bool request_shipping() const override;
60 bool request_payer_name() const override; 61 bool request_payer_name() const override;
61 bool request_payer_phone() const override; 62 bool request_payer_phone() const override;
62 bool request_payer_email() const override; 63 bool request_payer_email() const override;
63 payments::PaymentShippingType shipping_type() const override; 64 payments::PaymentShippingType shipping_type() const override;
64 65
65 // Returns the payments::CurrencyFormatter instance for this PaymentRequest. 66 // Returns the payments::CurrencyFormatter instance for this PaymentRequest.
66 // Note: Having multiple currencies per PaymentRequest flow is not supported; 67 // Note: Having multiple currencies per PaymentRequest flow is not supported;
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 std::vector<std::string> supported_card_networks_; 202 std::vector<std::string> supported_card_networks_;
202 // A subset of |supported_card_networks_| which is only the networks that have 203 // A subset of |supported_card_networks_| which is only the networks that have
203 // been specified as part of the "basic-card" supported method. Callers should 204 // been specified as part of the "basic-card" supported method. Callers should
204 // use |supported_card_networks_| for merchant support checks. 205 // use |supported_card_networks_| for merchant support checks.
205 std::set<std::string> basic_card_specified_networks_; 206 std::set<std::string> basic_card_specified_networks_;
206 207
207 // A vector of pointers to the shipping options in |web_payment_request_|. 208 // A vector of pointers to the shipping options in |web_payment_request_|.
208 std::vector<web::PaymentShippingOption*> shipping_options_; 209 std::vector<web::PaymentShippingOption*> shipping_options_;
209 web::PaymentShippingOption* selected_shipping_option_; 210 web::PaymentShippingOption* selected_shipping_option_;
210 211
212 payments::PaymentsProfileComparator profile_comparator_;
213
211 DISALLOW_COPY_AND_ASSIGN(PaymentRequest); 214 DISALLOW_COPY_AND_ASSIGN(PaymentRequest);
212 }; 215 };
213 216
214 #endif // IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_H_ 217 #endif // IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_H_
OLDNEW
« no previous file with comments | « components/payments/content/payment_request_state.cc ('k') | ios/chrome/browser/payments/payment_request.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698