Chromium Code Reviews| Index: chrome/browser/ui/views/payments/editor_view_controller.cc |
| diff --git a/chrome/browser/ui/views/payments/editor_view_controller.cc b/chrome/browser/ui/views/payments/editor_view_controller.cc |
| index 94b23bce9d0ec82646bd231ead9807c8a99eb64f..c20c2caafe2c1092a5738b658c9bb5ef29d494e5 100644 |
| --- a/chrome/browser/ui/views/payments/editor_view_controller.cc |
| +++ b/chrome/browser/ui/views/payments/editor_view_controller.cc |
| @@ -49,7 +49,8 @@ constexpr int kNumCharactersInLongField = 20; |
| EditorViewController::EditorViewController(PaymentRequestSpec* spec, |
| PaymentRequestState* state, |
| PaymentRequestDialogView* dialog) |
| - : PaymentRequestSheetController(spec, state, dialog) {} |
| + : PaymentRequestSheetController(spec, state, dialog), |
| + first_field_view_(nullptr) {} |
| EditorViewController::~EditorViewController() {} |
| @@ -132,6 +133,12 @@ void EditorViewController::ButtonPressed(views::Button* sender, |
| } |
| } |
| +views::View* EditorViewController::GetFirstFocusedView() { |
| + if (first_field_view_) |
| + return first_field_view_; |
| + return PaymentRequestSheetController::GetFirstFocusedView(); |
| +} |
| + |
| void EditorViewController::ContentsChanged(views::Textfield* sender, |
| const base::string16& new_contents) { |
| static_cast<ValidatingTextfield*>(sender)->OnContentsChanged(); |
| @@ -214,6 +221,10 @@ void EditorViewController::CreateInputField(views::GridLayout* layout, |
| : kNumCharactersInLongField); |
| text_fields_.insert(std::make_pair(text_field, field)); |
| + |
| + if (!first_field_view_) |
|
Mathieu
2017/05/04 19:32:34
TODO(crbug.com/xxxxxx): Should be the first view t
anthonyvd
2017/05/04 20:56:59
Done.
|
| + first_field_view_ = text_field; |
| + |
| // |text_field| will now be owned by |row|. |
| layout->AddView(text_field); |
| } else if (field.control_type == EditorField::ControlType::COMBOBOX) { |
| @@ -224,6 +235,10 @@ void EditorViewController::CreateInputField(views::GridLayout* layout, |
| combobox->set_id(static_cast<int>(field.type)); |
| combobox->set_listener(this); |
| comboboxes_.insert(std::make_pair(combobox, field)); |
| + |
| + if (!first_field_view_) |
| + first_field_view_ = combobox; |
| + |
| // |combobox| will now be owned by |row|. |
| layout->AddView(combobox); |
| } else { |