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

Side by Side Diff: chrome/browser/ui/views/payments/payment_sheet_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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/payment_sheet_view_controller.h" 5 #include "chrome/browser/ui/views/payments/payment_sheet_view_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 // +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ 330 // +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+
331 std::unique_ptr<views::Button> CreateWithButton( 331 std::unique_ptr<views::Button> CreateWithButton(
332 std::unique_ptr<views::View> content_view, 332 std::unique_ptr<views::View> content_view,
333 const base::string16& button_string, 333 const base::string16& button_string,
334 bool button_enabled) { 334 bool button_enabled) {
335 std::unique_ptr<views::Button> button( 335 std::unique_ptr<views::Button> button(
336 views::MdTextButton::CreateSecondaryUiBlueButton(listener_, 336 views::MdTextButton::CreateSecondaryUiBlueButton(listener_,
337 button_string)); 337 button_string));
338 button->set_tag(tag_); 338 button->set_tag(tag_);
339 button->set_id(id_); 339 button->set_id(id_);
340 button->SetFocusBehavior(views::View::FocusBehavior::ALWAYS);
340 button->SetEnabled(button_enabled); 341 button->SetEnabled(button_enabled);
341 return CreatePaymentSheetRow(listener_, section_name_, 342 return CreatePaymentSheetRow(listener_, section_name_,
342 std::move(content_view), nullptr, 343 std::move(content_view), nullptr,
343 std::move(button), /*clickable=*/false, 344 std::move(button), /*clickable=*/false,
344 /*extra_trailing_inset=*/false); 345 /*extra_trailing_inset=*/false);
345 } 346 }
346 347
347 views::ButtonListener* listener_; 348 views::ButtonListener* listener_;
348 base::string16 section_name_; 349 base::string16 section_name_;
349 int tag_; 350 int tag_;
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after
927 data_source_label->SetDefaultStyle(default_style); 928 data_source_label->SetDefaultStyle(default_style);
928 data_source_label->AddStyleRange( 929 data_source_label->AddStyleRange(
929 gfx::Range(link_begin, link_begin + link_length), 930 gfx::Range(link_begin, link_begin + link_length),
930 views::StyledLabel::RangeStyleInfo::CreateForLink()); 931 views::StyledLabel::RangeStyleInfo::CreateForLink());
931 data_source_label->SizeToFit(0); 932 data_source_label->SizeToFit(0);
932 content_view->AddChildView(data_source_label.release()); 933 content_view->AddChildView(data_source_label.release());
933 return content_view; 934 return content_view;
934 } 935 }
935 936
936 } // namespace payments 937 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698