| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/ui/autofill/autofill_dialog_controller_impl.h" | 5 #include "chrome/browser/ui/autofill/autofill_dialog_controller_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 // The credit card name is filled from the billing section's data. | 138 // The credit card name is filled from the billing section's data. |
| 139 if (field.type() == CREDIT_CARD_NAME && | 139 if (field.type() == CREDIT_CARD_NAME && |
| 140 (section == SECTION_BILLING || section == SECTION_CC_BILLING)) { | 140 (section == SECTION_BILLING || section == SECTION_CC_BILLING)) { |
| 141 return input.type == NAME_BILLING_FULL; | 141 return input.type == NAME_BILLING_FULL; |
| 142 } | 142 } |
| 143 | 143 |
| 144 return InputTypeMatchesFieldType(input, field.type()); | 144 return InputTypeMatchesFieldType(input, field.type()); |
| 145 } | 145 } |
| 146 | 146 |
| 147 bool IsCreditCardType(AutofillFieldType type) { | 147 bool IsCreditCardType(AutofillFieldType type) { |
| 148 return AutofillType(type).group() == AutofillType::CREDIT_CARD; | 148 return AutofillType(type).group() == CREDIT_CARD; |
| 149 } | 149 } |
| 150 | 150 |
| 151 // Returns true if |input| should be used to fill a site-requested |field| which | 151 // Returns true if |input| should be used to fill a site-requested |field| which |
| 152 // is notated with a "shipping" tag, for use when the user has decided to use | 152 // is notated with a "shipping" tag, for use when the user has decided to use |
| 153 // the billing address as the shipping address. | 153 // the billing address as the shipping address. |
| 154 bool DetailInputMatchesShippingField(const DetailInput& input, | 154 bool DetailInputMatchesShippingField(const DetailInput& input, |
| 155 const AutofillField& field) { | 155 const AutofillField& field) { |
| 156 // Equivalent billing field type is used to support UseBillingAsShipping | 156 // Equivalent billing field type is used to support UseBillingAsShipping |
| 157 // usecase. | 157 // usecase. |
| 158 AutofillFieldType field_type = | 158 AutofillFieldType field_type = |
| (...skipping 3310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3469 view_->GetUserInput(SECTION_CC_BILLING, &output); | 3469 view_->GetUserInput(SECTION_CC_BILLING, &output); |
| 3470 CreditCard card; | 3470 CreditCard card; |
| 3471 GetBillingInfoFromOutputs(output, &card, NULL, NULL); | 3471 GetBillingInfoFromOutputs(output, &card, NULL, NULL); |
| 3472 backing_last_four = card.TypeAndLastFourDigits(); | 3472 backing_last_four = card.TypeAndLastFourDigits(); |
| 3473 } | 3473 } |
| 3474 AutofillCreditCardBubbleController::ShowGeneratedCardUI( | 3474 AutofillCreditCardBubbleController::ShowGeneratedCardUI( |
| 3475 web_contents(), backing_last_four, full_wallet_->TypeAndLastFourDigits()); | 3475 web_contents(), backing_last_four, full_wallet_->TypeAndLastFourDigits()); |
| 3476 } | 3476 } |
| 3477 | 3477 |
| 3478 } // namespace autofill | 3478 } // namespace autofill |
| OLD | NEW |