| 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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 DCHECK_NE(0, error_ids); | 448 DCHECK_NE(0, error_ids); |
| 449 | 449 |
| 450 // The other error types are strings of the form "XXX. You can pay without | 450 // The other error types are strings of the form "XXX. You can pay without |
| 451 // wallet." | 451 // wallet." |
| 452 scoped_ptr<DialogNotification> notification(new DialogNotification( | 452 scoped_ptr<DialogNotification> notification(new DialogNotification( |
| 453 DialogNotification::WALLET_ERROR, | 453 DialogNotification::WALLET_ERROR, |
| 454 l10n_util::GetStringFUTF16(IDS_AUTOFILL_DIALOG_COMPLETE_WITHOUT_WALLET, | 454 l10n_util::GetStringFUTF16(IDS_AUTOFILL_DIALOG_COMPLETE_WITHOUT_WALLET, |
| 455 l10n_util::GetStringUTF16(error_ids)))); | 455 l10n_util::GetStringUTF16(error_ids)))); |
| 456 | 456 |
| 457 if (error_code) { | 457 if (error_code) { |
| 458 notification->set_tooltip_text( | 458 notification->set_learn_more_text( |
| 459 l10n_util::GetStringFUTF16(IDS_AUTOFILL_WALLET_ERROR_CODE_TOOLTIP, | 459 l10n_util::GetStringFUTF16(IDS_AUTOFILL_WALLET_ERROR_CODE_LEARN_MORE, |
| 460 base::IntToString16(error_code))); | 460 base::IntToString16(error_code))); |
| 461 } | 461 } |
| 462 | 462 |
| 463 return notification.Pass(); | 463 return notification.Pass(); |
| 464 } | 464 } |
| 465 | 465 |
| 466 gfx::Image GetGeneratedCardImage(const base::string16& card_number, | 466 gfx::Image GetGeneratedCardImage(const base::string16& card_number, |
| 467 const base::string16& name, | 467 const base::string16& name, |
| 468 const SkColor& gradient_top, | 468 const SkColor& gradient_top, |
| 469 const SkColor& gradient_bottom) { | 469 const SkColor& gradient_bottom) { |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 768 | 768 |
| 769 string16 AutofillDialogControllerImpl::ConfirmButtonText() const { | 769 string16 AutofillDialogControllerImpl::ConfirmButtonText() const { |
| 770 return l10n_util::GetStringUTF16(IsSubmitPausedOn(wallet::VERIFY_CVV) ? | 770 return l10n_util::GetStringUTF16(IsSubmitPausedOn(wallet::VERIFY_CVV) ? |
| 771 IDS_AUTOFILL_DIALOG_VERIFY_BUTTON : IDS_AUTOFILL_DIALOG_SUBMIT_BUTTON); | 771 IDS_AUTOFILL_DIALOG_VERIFY_BUTTON : IDS_AUTOFILL_DIALOG_SUBMIT_BUTTON); |
| 772 } | 772 } |
| 773 | 773 |
| 774 string16 AutofillDialogControllerImpl::SaveLocallyText() const { | 774 string16 AutofillDialogControllerImpl::SaveLocallyText() const { |
| 775 return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_SAVE_LOCALLY_CHECKBOX); | 775 return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_SAVE_LOCALLY_CHECKBOX); |
| 776 } | 776 } |
| 777 | 777 |
| 778 string16 AutofillDialogControllerImpl::SaveLocallyTooltip() const { | 778 string16 AutofillDialogControllerImpl::SaveLocallyLearnMoreText() const { |
| 779 return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_SAVE_LOCALLY_TOOLTIP); | 779 return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_SAVE_LOCALLY_LEARN_MORE); |
| 780 } | 780 } |
| 781 | 781 |
| 782 string16 AutofillDialogControllerImpl::LegalDocumentsText() { | 782 string16 AutofillDialogControllerImpl::LegalDocumentsText() { |
| 783 if (!IsPayingWithWallet()) | 783 if (!IsPayingWithWallet()) |
| 784 return string16(); | 784 return string16(); |
| 785 | 785 |
| 786 return legal_documents_text_; | 786 return legal_documents_text_; |
| 787 } | 787 } |
| 788 | 788 |
| 789 bool AutofillDialogControllerImpl::ShouldDisableSignInLink() const { | 789 bool AutofillDialogControllerImpl::ShouldDisableSignInLink() const { |
| (...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1628 CvcIconForCreditCardType(credit_card_type); | 1628 CvcIconForCreditCardType(credit_card_type); |
| 1629 | 1629 |
| 1630 return result; | 1630 return result; |
| 1631 } | 1631 } |
| 1632 | 1632 |
| 1633 bool AutofillDialogControllerImpl::FieldControlsIcons( | 1633 bool AutofillDialogControllerImpl::FieldControlsIcons( |
| 1634 ServerFieldType type) const { | 1634 ServerFieldType type) const { |
| 1635 return type == CREDIT_CARD_NUMBER; | 1635 return type == CREDIT_CARD_NUMBER; |
| 1636 } | 1636 } |
| 1637 | 1637 |
| 1638 string16 AutofillDialogControllerImpl::TooltipForField(ServerFieldType type) | 1638 string16 AutofillDialogControllerImpl::LearnMoreTextForField( |
| 1639 const { | 1639 ServerFieldType type) const { |
| 1640 if (type == PHONE_HOME_WHOLE_NUMBER || type == PHONE_BILLING_WHOLE_NUMBER) | 1640 if (type == PHONE_HOME_WHOLE_NUMBER || type == PHONE_BILLING_WHOLE_NUMBER) { |
| 1641 return l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_TOOLTIP_PHONE_NUMBER); | 1641 return l10n_util::GetStringUTF16( |
| 1642 IDS_AUTOFILL_DIALOG_LEARN_MORE_PHONE_NUMBER); |
| 1643 } |
| 1642 | 1644 |
| 1643 return string16(); | 1645 return string16(); |
| 1644 } | 1646 } |
| 1645 | 1647 |
| 1646 bool AutofillDialogControllerImpl::InputIsEditable( | 1648 bool AutofillDialogControllerImpl::InputIsEditable( |
| 1647 const DetailInput& input, | 1649 const DetailInput& input, |
| 1648 DialogSection section) { | 1650 DialogSection section) { |
| 1649 if (section != SECTION_CC_BILLING) | 1651 if (section != SECTION_CC_BILLING) |
| 1650 return true; | 1652 return true; |
| 1651 | 1653 |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2011 } | 2013 } |
| 2012 | 2014 |
| 2013 if (notifications.empty() && MenuModelForAccountChooser()) { | 2015 if (notifications.empty() && MenuModelForAccountChooser()) { |
| 2014 base::string16 text = l10n_util::GetStringUTF16( | 2016 base::string16 text = l10n_util::GetStringUTF16( |
| 2015 IsManuallyEditingAnySection() ? | 2017 IsManuallyEditingAnySection() ? |
| 2016 IDS_AUTOFILL_DIALOG_SAVE_DETAILS_IN_WALLET : | 2018 IDS_AUTOFILL_DIALOG_SAVE_DETAILS_IN_WALLET : |
| 2017 IDS_AUTOFILL_DIALOG_USE_WALLET); | 2019 IDS_AUTOFILL_DIALOG_USE_WALLET); |
| 2018 DialogNotification notification( | 2020 DialogNotification notification( |
| 2019 DialogNotification::WALLET_USAGE_CONFIRMATION, | 2021 DialogNotification::WALLET_USAGE_CONFIRMATION, |
| 2020 text); | 2022 text); |
| 2021 notification.set_tooltip_text( | 2023 notification.set_learn_more_text( |
| 2022 l10n_util::GetStringUTF16( | 2024 l10n_util::GetStringUTF16( |
| 2023 IDS_AUTOFILL_DIALOG_SAVE_IN_WALLET_TOOLTIP)); | 2025 IDS_AUTOFILL_DIALOG_SAVE_IN_WALLET_LEARN_MORE)); |
| 2024 notification.set_checked(IsPayingWithWallet()); | 2026 notification.set_checked(IsPayingWithWallet()); |
| 2025 notifications.push_back(notification); | 2027 notifications.push_back(notification); |
| 2026 } | 2028 } |
| 2027 | 2029 |
| 2028 if (IsPayingWithWallet() && !wallet::IsUsingProd()) { | 2030 if (IsPayingWithWallet() && !wallet::IsUsingProd()) { |
| 2029 notifications.push_back(DialogNotification( | 2031 notifications.push_back(DialogNotification( |
| 2030 DialogNotification::DEVELOPER_WARNING, | 2032 DialogNotification::DEVELOPER_WARNING, |
| 2031 l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_NOT_PROD_WARNING))); | 2033 l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_NOT_PROD_WARNING))); |
| 2032 } | 2034 } |
| 2033 | 2035 |
| (...skipping 1549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3583 net::URLRequestContextGetter* request_context = profile_->GetRequestContext(); | 3585 net::URLRequestContextGetter* request_context = profile_->GetRequestContext(); |
| 3584 signin_helper_.reset(new wallet::WalletSigninHelper(this, request_context)); | 3586 signin_helper_.reset(new wallet::WalletSigninHelper(this, request_context)); |
| 3585 signin_helper_->StartWalletCookieValueFetch(); | 3587 signin_helper_->StartWalletCookieValueFetch(); |
| 3586 | 3588 |
| 3587 username_fetcher_.reset( | 3589 username_fetcher_.reset( |
| 3588 new wallet::WalletSigninHelper(this, request_context)); | 3590 new wallet::WalletSigninHelper(this, request_context)); |
| 3589 username_fetcher_->StartUserNameFetch(); | 3591 username_fetcher_->StartUserNameFetch(); |
| 3590 } | 3592 } |
| 3591 | 3593 |
| 3592 } // namespace autofill | 3594 } // namespace autofill |
| OLD | NEW |