| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 93 |
| 94 const std::vector<autofill::CreditCard*>& credit_cards() { | 94 const std::vector<autofill::CreditCard*>& credit_cards() { |
| 95 return credit_cards_; | 95 return credit_cards_; |
| 96 } | 96 } |
| 97 | 97 |
| 98 // Returns the currently selected credit card for this PaymentRequest flow. | 98 // Returns the currently selected credit card for this PaymentRequest flow. |
| 99 // It's not guaranteed to be complete. Returns nullptr if there is no selected | 99 // It's not guaranteed to be complete. Returns nullptr if there is no selected |
| 100 // card. | 100 // card. |
| 101 autofill::CreditCard* selected_credit_card() { return selected_credit_card_; } | 101 autofill::CreditCard* selected_credit_card() { return selected_credit_card_; } |
| 102 | 102 |
| 103 void set_selected_credit_card(autofill::CreditCard* credit_card) { |
| 104 selected_credit_card_ = credit_card; |
| 105 } |
| 106 |
| 103 autofill::PersonalDataManager* personal_data_manager() { | 107 autofill::PersonalDataManager* personal_data_manager() { |
| 104 return delegate_->GetPersonalDataManager(); | 108 return delegate_->GetPersonalDataManager(); |
| 105 } | 109 } |
| 106 | 110 |
| 107 payments::mojom::PaymentDetails* details() { return details_.get(); } | 111 payments::mojom::PaymentDetails* details() { return details_.get(); } |
| 108 const std::vector<std::string>& supported_card_networks() { | 112 const std::vector<std::string>& supported_card_networks() { |
| 109 return supported_card_networks_; | 113 return supported_card_networks_; |
| 110 } | 114 } |
| 111 content::WebContents* web_contents() { return web_contents_; } | 115 content::WebContents* web_contents() { return web_contents_; } |
| 112 | 116 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 std::vector<std::unique_ptr<autofill::CreditCard>> card_cache_; | 149 std::vector<std::unique_ptr<autofill::CreditCard>> card_cache_; |
| 146 std::vector<autofill::CreditCard*> credit_cards_; | 150 std::vector<autofill::CreditCard*> credit_cards_; |
| 147 autofill::CreditCard* selected_credit_card_; | 151 autofill::CreditCard* selected_credit_card_; |
| 148 | 152 |
| 149 DISALLOW_COPY_AND_ASSIGN(PaymentRequest); | 153 DISALLOW_COPY_AND_ASSIGN(PaymentRequest); |
| 150 }; | 154 }; |
| 151 | 155 |
| 152 } // namespace payments | 156 } // namespace payments |
| 153 | 157 |
| 154 #endif // COMPONENTS_PAYMENTS_PAYMENT_REQUEST_H_ | 158 #endif // COMPONENTS_PAYMENTS_PAYMENT_REQUEST_H_ |
| OLD | NEW |