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

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

Issue 2896263002: [Payments] Changes to validation in the Credit Card 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 #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 29 matching lines...) Expand all
40 Validate(); 40 Validate();
41 } 41 }
42 42
43 void ValidatingCombobox::OnComboboxModelChanged( 43 void ValidatingCombobox::OnComboboxModelChanged(
44 ui::ComboboxModel* unused_model) { 44 ui::ComboboxModel* unused_model) {
45 ModelChanged(); 45 ModelChanged();
46 delegate_->ComboboxModelChanged(this); 46 delegate_->ComboboxModelChanged(this);
47 } 47 }
48 48
49 bool ValidatingCombobox::IsValid() { 49 bool ValidatingCombobox::IsValid() {
50 bool valid = delegate_->IsValidCombobox(this); 50 return delegate_->IsValidCombobox(this);
51 SetInvalid(!valid);
52 return valid;
53 } 51 }
54 52
55 void ValidatingCombobox::Validate() { 53 void ValidatingCombobox::Validate() {
56 // ComboboxValueChanged may have side-effects, such as displaying errors. 54 // ComboboxValueChanged may have side-effects, such as displaying errors.
57 SetInvalid(!delegate_->ComboboxValueChanged(this)); 55 SetInvalid(!delegate_->ComboboxValueChanged(this));
58 } 56 }
59 57
60 } // namespace payments 58 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698