| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |