| 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 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 834 state.expiry = base::TimeDelta::FromMilliseconds(100); | 834 state.expiry = base::TimeDelta::FromMilliseconds(100); |
| 835 | 835 |
| 836 // "Submitting" waiting page. | 836 // "Submitting" waiting page. |
| 837 string.text = l10n_util::GetStringUTF16( | 837 string.text = l10n_util::GetStringUTF16( |
| 838 IDS_AUTOFILL_DIALOG_CARD_GENERATION_IN_PROGRESS); | 838 IDS_AUTOFILL_DIALOG_CARD_GENERATION_IN_PROGRESS); |
| 839 } | 839 } |
| 840 | 840 |
| 841 return state; | 841 return state; |
| 842 } | 842 } |
| 843 | 843 |
| 844 const std::vector<ui::Range>& AutofillDialogControllerImpl:: | 844 const std::vector<gfx::Range>& AutofillDialogControllerImpl:: |
| 845 LegalDocumentLinks() { | 845 LegalDocumentLinks() { |
| 846 EnsureLegalDocumentsText(); | 846 EnsureLegalDocumentsText(); |
| 847 return legal_document_link_ranges_; | 847 return legal_document_link_ranges_; |
| 848 } | 848 } |
| 849 | 849 |
| 850 bool AutofillDialogControllerImpl::SectionIsActive(DialogSection section) | 850 bool AutofillDialogControllerImpl::SectionIsActive(DialogSection section) |
| 851 const { | 851 const { |
| 852 if (IsSubmitPausedOn(wallet::VERIFY_CVV)) | 852 if (IsSubmitPausedOn(wallet::VERIFY_CVV)) |
| 853 return section == SECTION_CC_BILLING; | 853 return section == SECTION_CC_BILLING; |
| 854 | 854 |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1027 new_user ? IDS_AUTOFILL_DIALOG_LEGAL_LINKS_NEW_3 : | 1027 new_user ? IDS_AUTOFILL_DIALOG_LEGAL_LINKS_NEW_3 : |
| 1028 IDS_AUTOFILL_DIALOG_LEGAL_LINKS_UPDATED_3, | 1028 IDS_AUTOFILL_DIALOG_LEGAL_LINKS_UPDATED_3, |
| 1029 documents[0]->display_name(), | 1029 documents[0]->display_name(), |
| 1030 documents[1]->display_name(), | 1030 documents[1]->display_name(), |
| 1031 documents[2]->display_name()); | 1031 documents[2]->display_name()); |
| 1032 } | 1032 } |
| 1033 | 1033 |
| 1034 legal_document_link_ranges_.clear(); | 1034 legal_document_link_ranges_.clear(); |
| 1035 for (size_t i = 0; i < documents.size(); ++i) { | 1035 for (size_t i = 0; i < documents.size(); ++i) { |
| 1036 size_t link_start = text.find(documents[i]->display_name()); | 1036 size_t link_start = text.find(documents[i]->display_name()); |
| 1037 legal_document_link_ranges_.push_back(ui::Range( | 1037 legal_document_link_ranges_.push_back(gfx::Range( |
| 1038 link_start, link_start + documents[i]->display_name().size())); | 1038 link_start, link_start + documents[i]->display_name().size())); |
| 1039 } | 1039 } |
| 1040 legal_documents_text_ = text; | 1040 legal_documents_text_ = text; |
| 1041 } | 1041 } |
| 1042 | 1042 |
| 1043 void AutofillDialogControllerImpl::ResetSectionInput(DialogSection section) { | 1043 void AutofillDialogControllerImpl::ResetSectionInput(DialogSection section) { |
| 1044 SetEditingExistingData(section, false); | 1044 SetEditingExistingData(section, false); |
| 1045 | 1045 |
| 1046 DetailInputs* inputs = MutableRequestedFieldsForSection(section); | 1046 DetailInputs* inputs = MutableRequestedFieldsForSection(section); |
| 1047 for (DetailInputs::iterator it = inputs->begin(); it != inputs->end(); ++it) { | 1047 for (DetailInputs::iterator it = inputs->begin(); it != inputs->end(); ++it) { |
| (...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1883 DialogNotification::Type type, bool checked) { | 1883 DialogNotification::Type type, bool checked) { |
| 1884 if (type == DialogNotification::WALLET_USAGE_CONFIRMATION) { | 1884 if (type == DialogNotification::WALLET_USAGE_CONFIRMATION) { |
| 1885 if (checked) | 1885 if (checked) |
| 1886 account_chooser_model_.SelectActiveWalletAccount(); | 1886 account_chooser_model_.SelectActiveWalletAccount(); |
| 1887 else | 1887 else |
| 1888 account_chooser_model_.SelectUseAutofill(); | 1888 account_chooser_model_.SelectUseAutofill(); |
| 1889 } | 1889 } |
| 1890 } | 1890 } |
| 1891 | 1891 |
| 1892 void AutofillDialogControllerImpl::LegalDocumentLinkClicked( | 1892 void AutofillDialogControllerImpl::LegalDocumentLinkClicked( |
| 1893 const ui::Range& range) { | 1893 const gfx::Range& range) { |
| 1894 for (size_t i = 0; i < legal_document_link_ranges_.size(); ++i) { | 1894 for (size_t i = 0; i < legal_document_link_ranges_.size(); ++i) { |
| 1895 if (legal_document_link_ranges_[i] == range) { | 1895 if (legal_document_link_ranges_[i] == range) { |
| 1896 OpenTabWithUrl(wallet_items_->legal_documents()[i]->url()); | 1896 OpenTabWithUrl(wallet_items_->legal_documents()[i]->url()); |
| 1897 return; | 1897 return; |
| 1898 } | 1898 } |
| 1899 } | 1899 } |
| 1900 | 1900 |
| 1901 NOTREACHED(); | 1901 NOTREACHED(); |
| 1902 } | 1902 } |
| 1903 | 1903 |
| (...skipping 1484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3388 } | 3388 } |
| 3389 | 3389 |
| 3390 void AutofillDialogControllerImpl::OnSubmitButtonDelayEnd() { | 3390 void AutofillDialogControllerImpl::OnSubmitButtonDelayEnd() { |
| 3391 if (!view_) | 3391 if (!view_) |
| 3392 return; | 3392 return; |
| 3393 ScopedViewUpdates updates(view_.get()); | 3393 ScopedViewUpdates updates(view_.get()); |
| 3394 view_->UpdateButtonStrip(); | 3394 view_->UpdateButtonStrip(); |
| 3395 } | 3395 } |
| 3396 | 3396 |
| 3397 } // namespace autofill | 3397 } // namespace autofill |
| OLD | NEW |