Commit 61f0a2b7 authored by estade's avatar estade Committed by Commit bot

Card unmasking prompt - mark cvc input as invalid as appropriate.

BUG=437116

Review URL: https://codereview.chromium.org/889043003

Cr-Commit-Position: refs/heads/master@{#314061}
parent 5dd590ed
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "chrome/browser/ui/autofill/autofill_dialog_models.h" #include "chrome/browser/ui/autofill/autofill_dialog_models.h"
#include "chrome/browser/ui/autofill/card_unmask_prompt_controller.h" #include "chrome/browser/ui/autofill/card_unmask_prompt_controller.h"
#include "chrome/browser/ui/autofill/card_unmask_prompt_view.h" #include "chrome/browser/ui/autofill/card_unmask_prompt_view.h"
#include "chrome/browser/ui/views/autofill/decorated_textfield.h"
#include "chrome/grit/generated_resources.h" #include "chrome/grit/generated_resources.h"
#include "components/constrained_window/constrained_window_views.h" #include "components/constrained_window/constrained_window_views.h"
#include "grit/theme_resources.h" #include "grit/theme_resources.h"
...@@ -16,7 +17,6 @@ ...@@ -16,7 +17,6 @@
#include "ui/views/controls/combobox/combobox_listener.h" #include "ui/views/controls/combobox/combobox_listener.h"
#include "ui/views/controls/image_view.h" #include "ui/views/controls/image_view.h"
#include "ui/views/controls/label.h" #include "ui/views/controls/label.h"
#include "ui/views/controls/textfield/textfield.h"
#include "ui/views/controls/textfield/textfield_controller.h" #include "ui/views/controls/textfield/textfield_controller.h"
#include "ui/views/layout/box_layout.h" #include "ui/views/layout/box_layout.h"
#include "ui/views/widget/widget.h" #include "ui/views/widget/widget.h"
...@@ -72,6 +72,7 @@ class CardUnmaskPromptViews : public CardUnmaskPromptView, ...@@ -72,6 +72,7 @@ class CardUnmaskPromptViews : public CardUnmaskPromptView,
base::TimeDelta::FromSeconds(1)); base::TimeDelta::FromSeconds(1));
} else { } else {
SetInputsEnabled(true); SetInputsEnabled(true);
cvc_input_->SetInvalid(true);
message_label_->SetText(base::ASCIIToUTF16("Verification error.")); message_label_->SetText(base::ASCIIToUTF16("Verification error."));
GetDialogClientView()->UpdateDialogButtons(); GetDialogClientView()->UpdateDialogButtons();
} }
...@@ -200,10 +201,10 @@ class CardUnmaskPromptViews : public CardUnmaskPromptView, ...@@ -200,10 +201,10 @@ class CardUnmaskPromptViews : public CardUnmaskPromptView,
input_row->AddChildView(year_input_); input_row->AddChildView(year_input_);
} }
cvc_input_ = new views::Textfield(); cvc_input_ = new DecoratedTextfield(
cvc_input_->set_controller(this); base::string16(),
cvc_input_->set_placeholder_text( l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_PLACEHOLDER_CVC),
l10n_util::GetStringUTF16(IDS_AUTOFILL_DIALOG_PLACEHOLDER_CVC)); this);
cvc_input_->set_default_width_in_chars(10); cvc_input_->set_default_width_in_chars(10);
input_row->AddChildView(cvc_input_); input_row->AddChildView(cvc_input_);
...@@ -223,7 +224,7 @@ class CardUnmaskPromptViews : public CardUnmaskPromptView, ...@@ -223,7 +224,7 @@ class CardUnmaskPromptViews : public CardUnmaskPromptView,
CardUnmaskPromptController* controller_; CardUnmaskPromptController* controller_;
views::Textfield* cvc_input_; DecoratedTextfield* cvc_input_;
// These will be null when expiration date is not required. // These will be null when expiration date is not required.
views::Combobox* month_input_; views::Combobox* month_input_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment