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

Side by Side Diff: chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc

Issue 21947003: [Autofill] Move FieldTypeGroup out of the AutofillType class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 4 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 | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/ui/android/autofill/autofill_dialog_view_android.cc ('k') | chrome/browser/ui/autofill/data_model_wrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698