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

Side by Side Diff: chrome/browser/ui/views/payments/contact_info_editor_view_controller.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 | « no previous file | chrome/browser/ui/views/payments/contact_info_editor_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 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_CONTACT_INFO_EDITOR_VIEW_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_CONTACT_INFO_EDITOR_VIEW_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_CONTACT_INFO_EDITOR_VIEW_CONTROLLER_H_ 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_CONTACT_INFO_EDITOR_VIEW_CONTROLLER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 base::OnceCallback<void(const autofill::AutofillProfile&)> on_added_; 65 base::OnceCallback<void(const autofill::AutofillProfile&)> on_added_;
66 66
67 class ContactInfoValidationDelegate : public ValidationDelegate { 67 class ContactInfoValidationDelegate : public ValidationDelegate {
68 public: 68 public:
69 ContactInfoValidationDelegate(const EditorField& field, 69 ContactInfoValidationDelegate(const EditorField& field,
70 const std::string& locale, 70 const std::string& locale,
71 EditorViewController* controller); 71 EditorViewController* controller);
72 ~ContactInfoValidationDelegate() override; 72 ~ContactInfoValidationDelegate() override;
73 73
74 // ValidationDelegate: 74 // ValidationDelegate:
75 bool ValidateTextfield(views::Textfield* textfield) override; 75 bool IsValidTextfield(views::Textfield* textfield) override;
76 bool ValidateCombobox(views::Combobox* combobox) override; 76 bool IsValidCombobox(views::Combobox* combobox) override;
77 bool TextfieldValueChanged(views::Textfield* textfield) override;
78 bool ComboboxValueChanged(views::Combobox* combobox) override;
77 void ComboboxModelChanged(views::Combobox* combobox) override {} 79 void ComboboxModelChanged(views::Combobox* combobox) override {}
78 80
79 private: 81 private:
82 bool ValidateTextfield(views::Textfield* textfield,
83 base::string16* error_message);
84
80 EditorField field_; 85 EditorField field_;
81 // Outlives this class. Never null. 86 // Outlives this class. Never null.
82 EditorViewController* controller_; 87 EditorViewController* controller_;
83 const std::string& locale_; 88 const std::string& locale_;
84 }; 89 };
85 }; 90 };
86 91
87 } // namespace payments 92 } // namespace payments
88 93
89 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_CONTACT_INFO_EDITOR_VIEW_CONTROLLER_ H_ 94 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_CONTACT_INFO_EDITOR_VIEW_CONTROLLER_ H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/payments/contact_info_editor_view_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698