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

Unified Diff: chrome/browser/ui/views/payments/payment_request_sheet_controller.h

Issue 2853163002: [Web Payments] Implement proper focusing in Payment Request (Closed)
Patch Set: Allow ViewControllers to specify their first focused view Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/payments/payment_request_sheet_controller.h
diff --git a/chrome/browser/ui/views/payments/payment_request_sheet_controller.h b/chrome/browser/ui/views/payments/payment_request_sheet_controller.h
index 5aa37b512029582340d3b2569b894555bb72f3cf..1ea621f8f82287caec9b651d2fe3adc7354537fe 100644
--- a/chrome/browser/ui/views/payments/payment_request_sheet_controller.h
+++ b/chrome/browser/ui/views/payments/payment_request_sheet_controller.h
@@ -92,6 +92,14 @@ class PaymentRequestSheetController : public views::ButtonListener {
// |controller| is installed as the listener for button events.
std::unique_ptr<views::View> CreateFooterView();
+ // Returns the view that should be initially focused on this sheet. Typically,
+ // this returns the primary button if it's enabled or the secondary button
+ // otherwise. Subclasses may return a different view if they need focus to
+ // start off on a different view (a textfield for example). This will only be
+ // called after the view has been completely created through calls to
+ // CreatePaymentView and related functions.
+ virtual views::View* GetFirstFocusedView();
+
private:
// Creates a view to be displayed in the PaymentRequestDialog.
// |header_view| is the view displayed on top of the dialog, containing title,
@@ -122,6 +130,8 @@ class PaymentRequestSheetController : public views::ButtonListener {
// Hold on to the ScrollView because it must be explicitly laid out in some
Mathieu 2017/05/02 13:16:10 update/split comment to reflect more variables
anthonyvd 2017/05/02 13:43:32 Done.
// cases.
std::unique_ptr<views::ScrollView> scroll_;
+ std::unique_ptr<views::Button> primary_button_;
+ std::unique_ptr<views::Button> secondary_button_;
DISALLOW_COPY_AND_ASSIGN(PaymentRequestSheetController);
};

Powered by Google App Engine
This is Rietveld 408576698