Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc

Issue 2922483002: [WebPayments] Making all fields and buttons focusable (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/views/payments/payment_method_view_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/views/payments/credit_card_editor_view_controller.h" 5 #include "chrome/browser/ui/views/payments/credit_card_editor_view_controller.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 322
323 std::unique_ptr<views::View> button_view = base::MakeUnique<views::View>(); 323 std::unique_ptr<views::View> button_view = base::MakeUnique<views::View>();
324 button_view->SetLayoutManager(new views::FillLayout); 324 button_view->SetLayoutManager(new views::FillLayout);
325 325
326 // The button to add new billing addresses. 326 // The button to add new billing addresses.
327 std::unique_ptr<views::Button> add_button( 327 std::unique_ptr<views::Button> add_button(
328 views::MdTextButton::Create(this, l10n_util::GetStringUTF16(IDS_ADD))); 328 views::MdTextButton::Create(this, l10n_util::GetStringUTF16(IDS_ADD)));
329 add_button->set_id( 329 add_button->set_id(
330 static_cast<int>(DialogViewID::ADD_BILLING_ADDRESS_BUTTON)); 330 static_cast<int>(DialogViewID::ADD_BILLING_ADDRESS_BUTTON));
331 add_button->set_tag(add_billing_address_button_tag_); 331 add_button->set_tag(add_billing_address_button_tag_);
332 add_button->SetFocusBehavior(views::View::FocusBehavior::ALWAYS);
332 button_view->AddChildView(add_button.release()); 333 button_view->AddChildView(add_button.release());
333 return button_view; 334 return button_view;
334 } 335 }
335 336
336 std::vector<EditorField> CreditCardEditorViewController::GetFieldDefinitions() { 337 std::vector<EditorField> CreditCardEditorViewController::GetFieldDefinitions() {
337 bool is_server_card = IsEditingServerCard(); 338 bool is_server_card = IsEditingServerCard();
338 return std::vector<EditorField>{ 339 return std::vector<EditorField>{
339 {autofill::CREDIT_CARD_NUMBER, 340 {autofill::CREDIT_CARD_NUMBER,
340 l10n_util::GetStringUTF16(IDS_AUTOFILL_FIELD_LABEL_CREDIT_CARD_NUMBER), 341 l10n_util::GetStringUTF16(IDS_AUTOFILL_FIELD_LABEL_CREDIT_CARD_NUMBER),
341 EditorField::LengthHint::HINT_SHORT, /*required=*/true, 342 EditorField::LengthHint::HINT_SHORT, /*required=*/true,
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 return ValidateValue(combobox->GetTextForRow(combobox->selected_index()), 715 return ValidateValue(combobox->GetTextForRow(combobox->selected_index()),
715 error_message); 716 error_message);
716 } 717 }
717 718
718 bool CreditCardEditorViewController::GetSheetId(DialogViewID* sheet_id) { 719 bool CreditCardEditorViewController::GetSheetId(DialogViewID* sheet_id) {
719 *sheet_id = DialogViewID::CREDIT_CARD_EDITOR_SHEET; 720 *sheet_id = DialogViewID::CREDIT_CARD_EDITOR_SHEET;
720 return true; 721 return true;
721 } 722 }
722 723
723 } // namespace payments 724 } // namespace payments
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/payments/payment_method_view_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698