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

Side by Side Diff: chrome/browser/ui/views/payments/validating_combobox.cc

Issue 2881643002: Focus first invalid field of payment request editor (Closed)
Patch Set: Updated API to create field views other small tweaks. 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 #include "chrome/browser/ui/views/payments/validating_combobox.h" 5 #include "chrome/browser/ui/views/payments/validating_combobox.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ui/base/models/combobox_model.h" 9 #include "ui/base/models/combobox_model.h"
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 Validate(); 47 Validate();
48 } 48 }
49 49
50 void ValidatingCombobox::OnComboboxModelChanged( 50 void ValidatingCombobox::OnComboboxModelChanged(
51 ui::ComboboxModel* unused_model) { 51 ui::ComboboxModel* unused_model) {
52 ModelChanged(); 52 ModelChanged();
53 delegate_->ComboboxModelChanged(this); 53 delegate_->ComboboxModelChanged(this);
54 } 54 }
55 55
56 bool ValidatingCombobox::IsValid() {
57 bool valid = delegate_->IsValidCombobox(this);
58 SetInvalid(!valid);
59 return valid;
60 }
61
56 void ValidatingCombobox::Validate() { 62 void ValidatingCombobox::Validate() {
57 // ValidateCombobox may have side-effects, such as displaying errors. 63 // ComboboxValueChanged may have side-effects, such as displaying errors.
58 SetInvalid(!delegate_->ValidateCombobox(this)); 64 SetInvalid(!delegate_->ComboboxValueChanged(this));
59 } 65 }
60 66
61 } // namespace payments 67 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698