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

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

Issue 2866443002: [Web Payments] Handle "Enter" accelerator when there's a primary action (Closed)
Patch Set: Add tests to sheets that handle the enter accelerator Created 3 years, 7 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 3a3eacba56a3030b75d09005e3a36f5cbd427e66..ac8e917015305687d5b0587f933c04c444b6d2e2 100644
--- a/chrome/browser/ui/views/payments/payment_request_sheet_controller.h
+++ b/chrome/browser/ui/views/payments/payment_request_sheet_controller.h
@@ -8,6 +8,7 @@
#include <memory>
#include "base/macros.h"
+#include "chrome/browser/ui/views/payments/payment_request_dialog_view_ids.h"
#include "ui/views/controls/button/button.h"
namespace views {
@@ -100,6 +101,10 @@ class PaymentRequestSheetController : public views::ButtonListener {
// CreatePaymentView and related functions.
virtual views::View* GetFirstFocusedView();
+ // Returns true if the subclass wants the content sheet to have an id, and
+ // sets |sheet_id| to the desired value.
+ virtual bool GetSheetId(DialogViewID* sheet_id);
+
private:
// Creates a view to be displayed in the PaymentRequestDialog.
// |header_view| is the view displayed on top of the dialog, containing title,
@@ -118,6 +123,11 @@ class PaymentRequestSheetController : public views::ButtonListener {
// +---------------------------+
std::unique_ptr<views::View> CreatePaymentView();
+ // Called when the Enter accelerator is pressed. Perform the action associated
+ // with the primary button and returns true if it's enabled, returns false
+ // otherwise.
+ bool PerformPrimaryButtonAction();
+
// All these are not owned. Will outlive this.
PaymentRequestSpec* spec_;
PaymentRequestState* state_;

Powered by Google App Engine
This is Rietveld 408576698