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 #include <utility> | 10 #include <utility> |
(...skipping 1667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1678 // The user manually input data. If using Autofill, save the info as new or | 1678 // The user manually input data. If using Autofill, save the info as new or |
1679 // edited data. Always fill local data into |form_structure_|. | 1679 // edited data. Always fill local data into |form_structure_|. |
1680 FieldValueMap output; | 1680 FieldValueMap output; |
1681 view_->GetUserInput(section, &output); | 1681 view_->GetUserInput(section, &output); |
1682 | 1682 |
1683 if (section == SECTION_CC) { | 1683 if (section == SECTION_CC) { |
1684 CreditCard card; | 1684 CreditCard card; |
1685 FillFormGroupFromOutputs(output, &card); | 1685 FillFormGroupFromOutputs(output, &card); |
1686 | 1686 |
1687 // The card holder name comes from the billing address section. | 1687 // The card holder name comes from the billing address section. |
1688 card.SetRawInfo(CREDIT_CARD_NAME, | 1688 card.SetRawInfo(CREDIT_CARD_NAME_FULL, |
1689 GetValueFromSection(SECTION_BILLING, NAME_BILLING_FULL)); | 1689 GetValueFromSection(SECTION_BILLING, NAME_BILLING_FULL)); |
1690 | 1690 |
1691 if (ShouldSaveDetailsLocally()) { | 1691 if (ShouldSaveDetailsLocally()) { |
1692 card.set_origin(kAutofillDialogOrigin); | 1692 card.set_origin(kAutofillDialogOrigin); |
1693 | 1693 |
1694 std::string guid = GetManager()->SaveImportedCreditCard(card); | 1694 std::string guid = GetManager()->SaveImportedCreditCard(card); |
1695 newly_saved_data_model_guids_[section] = guid; | 1695 newly_saved_data_model_guids_[section] = guid; |
1696 DCHECK(!profile()->IsOffTheRecord()); | 1696 DCHECK(!profile()->IsOffTheRecord()); |
1697 newly_saved_card_.reset(new CreditCard(card)); | 1697 newly_saved_card_.reset(new CreditCard(card)); |
1698 } | 1698 } |
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2308 } | 2308 } |
2309 | 2309 |
2310 void AutofillDialogControllerImpl::OnSubmitButtonDelayEnd() { | 2310 void AutofillDialogControllerImpl::OnSubmitButtonDelayEnd() { |
2311 if (!view_) | 2311 if (!view_) |
2312 return; | 2312 return; |
2313 ScopedViewUpdates updates(view_.get()); | 2313 ScopedViewUpdates updates(view_.get()); |
2314 view_->UpdateButtonStrip(); | 2314 view_->UpdateButtonStrip(); |
2315 } | 2315 } |
2316 | 2316 |
2317 } // namespace autofill | 2317 } // namespace autofill |
OLD | NEW |