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

Side by Side Diff: chrome/browser/ui/views/payments/validation_delegate.h

Issue 2881643002: Focus first invalid field of payment request editor (Closed)
Patch Set: Last final nit :-) 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/views/payments/validating_textfield_unittest.cc ('k') | no next file » | 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 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_VALIDATION_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_VALIDATION_DELEGATE_H_
6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_VALIDATION_DELEGATE_H_ 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_VALIDATION_DELEGATE_H_
7 7
8 namespace views { 8 namespace views {
9 class Combobox; 9 class Combobox;
10 class Textfield; 10 class Textfield;
11 } // namespace views 11 } // namespace views
12 12
13 namespace payments { 13 namespace payments {
14 14
15 class ValidationDelegate { 15 class ValidationDelegate {
16 public: 16 public:
17 virtual ~ValidationDelegate() {} 17 virtual ~ValidationDelegate() {}
18 18
19 // Only the delegate knows how to validate the textfield. 19 // Only the delegate knows how to validate the input fields.
20 virtual bool ValidateTextfield(views::Textfield* textfield) = 0; 20 virtual bool IsValidTextfield(views::Textfield* textfield) = 0;
21 virtual bool IsValidCombobox(views::Combobox* combobox) = 0;
21 22
22 virtual bool ValidateCombobox(views::Combobox* combobox) = 0; 23 // Notifications to let delegate react to input field changes and also let
24 // caller know if the new values are valid.
25 virtual bool TextfieldValueChanged(views::Textfield* textfield) = 0;
26 virtual bool ComboboxValueChanged(views::Combobox* combobox) = 0;
27
28 // Lets the delegate know that the model of the combobox has changed, e.g.,
29 // when it gets filled asynchronously as for the state field.
23 virtual void ComboboxModelChanged(views::Combobox* combobox) = 0; 30 virtual void ComboboxModelChanged(views::Combobox* combobox) = 0;
24 }; 31 };
25 32
26 } // namespace payments 33 } // namespace payments
27 34
28 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_VALIDATION_DELEGATE_H_ 35 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_VALIDATION_DELEGATE_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/payments/validating_textfield_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698