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

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

Issue 2881643002: Focus first invalid field of payment request editor (Closed)
Patch Set: Rebase 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
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_SHIPPING_ADDRESS_EDITOR_VIEW_CONTROLLER _H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_SHIPPING_ADDRESS_EDITOR_VIEW_CONTROLLER _H_
6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_SHIPPING_ADDRESS_EDITOR_VIEW_CONTROLLER _H_ 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_SHIPPING_ADDRESS_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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 bool GetSheetId(DialogViewID* sheet_id) override; 62 bool GetSheetId(DialogViewID* sheet_id) override;
63 63
64 class ShippingAddressValidationDelegate : public ValidationDelegate { 64 class ShippingAddressValidationDelegate : public ValidationDelegate {
65 public: 65 public:
66 ShippingAddressValidationDelegate( 66 ShippingAddressValidationDelegate(
67 ShippingAddressEditorViewController* parent, 67 ShippingAddressEditorViewController* parent,
68 const EditorField& field); 68 const EditorField& field);
69 ~ShippingAddressValidationDelegate() override; 69 ~ShippingAddressValidationDelegate() override;
70 70
71 // ValidationDelegate: 71 // ValidationDelegate:
72 bool ValidateTextfield(views::Textfield* textfield) override; 72 bool ValidateTextfield(views::Textfield* textfield,
73 bool ValidateCombobox(views::Combobox* combobox) override; 73 bool display_error) override;
74 bool ValidateCombobox(views::Combobox* combobox,
75 bool display_error) override;
74 void ComboboxModelChanged(views::Combobox* combobox) override; 76 void ComboboxModelChanged(views::Combobox* combobox) override;
75 77
76 private: 78 private:
77 bool ValidateValue(const base::string16& value); 79 bool ValidateValue(const base::string16& value, bool display_error);
78 80
79 EditorField field_; 81 EditorField field_;
80 82
81 // Raw pointer back to the owner of this class, therefore will not be null. 83 // Raw pointer back to the owner of this class, therefore will not be null.
82 ShippingAddressEditorViewController* controller_; 84 ShippingAddressEditorViewController* controller_;
83 85
84 DISALLOW_COPY_AND_ASSIGN(ShippingAddressValidationDelegate); 86 DISALLOW_COPY_AND_ASSIGN(ShippingAddressValidationDelegate);
85 }; 87 };
86 friend class ShippingAddressValidationDelegate; 88 friend class ShippingAddressValidationDelegate;
87 89
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 134
133 // Failed to fetch the region data in time. 135 // Failed to fetch the region data in time.
134 void RegionDataLoadTimedOut(); 136 void RegionDataLoadTimedOut();
135 137
136 DISALLOW_COPY_AND_ASSIGN(ShippingAddressEditorViewController); 138 DISALLOW_COPY_AND_ASSIGN(ShippingAddressEditorViewController);
137 }; 139 };
138 140
139 } // namespace payments 141 } // namespace payments
140 142
141 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_SHIPPING_ADDRESS_EDITOR_VIEW_CONTROL LER_H_ 143 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_SHIPPING_ADDRESS_EDITOR_VIEW_CONTROL LER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698