| 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/shipping_address_editor_view_controll
er.h" | 5 #include "chrome/browser/ui/views/payments/shipping_address_editor_view_controll
er.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 } | 320 } |
| 321 | 321 |
| 322 void ShippingAddressEditorViewController::OnDataChanged() { | 322 void ShippingAddressEditorViewController::OnDataChanged() { |
| 323 // TODO(crbug.com/703764): save the current state so we can map it to the new | 323 // TODO(crbug.com/703764): save the current state so we can map it to the new |
| 324 // country fields as best we can. | 324 // country fields as best we can. |
| 325 UpdateEditorFields(); | 325 UpdateEditorFields(); |
| 326 | 326 |
| 327 // The editor can't be updated while in the middle of a combobox event. | 327 // The editor can't be updated while in the middle of a combobox event. |
| 328 base::ThreadTaskRunnerHandle::Get()->PostTask( | 328 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 329 FROM_HERE, | 329 FROM_HERE, |
| 330 base::Bind(&ShippingAddressEditorViewController::UpdateEditorView, | 330 base::BindOnce(&ShippingAddressEditorViewController::UpdateEditorView, |
| 331 base::Unretained(this))); | 331 base::Unretained(this))); |
| 332 } | 332 } |
| 333 | 333 |
| 334 void ShippingAddressEditorViewController::OnComboboxModelChanged( | 334 void ShippingAddressEditorViewController::OnComboboxModelChanged( |
| 335 views::Combobox* combobox) { | 335 views::Combobox* combobox) { |
| 336 if (combobox->id() != autofill::ADDRESS_HOME_STATE) | 336 if (combobox->id() != autofill::ADDRESS_HOME_STATE) |
| 337 return; | 337 return; |
| 338 autofill::RegionComboboxModel* model = | 338 autofill::RegionComboboxModel* model = |
| 339 static_cast<autofill::RegionComboboxModel*>(combobox->model()); | 339 static_cast<autofill::RegionComboboxModel*>(combobox->model()); |
| 340 if (model->pending_region_data_load()) | 340 if (model->pending_region_data_load()) |
| 341 return; | 341 return; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 bool is_required_valid = !field_.required; | 389 bool is_required_valid = !field_.required; |
| 390 const base::string16 displayed_message = | 390 const base::string16 displayed_message = |
| 391 is_required_valid ? base::ASCIIToUTF16("") | 391 is_required_valid ? base::ASCIIToUTF16("") |
| 392 : l10n_util::GetStringUTF16( | 392 : l10n_util::GetStringUTF16( |
| 393 IDS_PAYMENTS_FIELD_REQUIRED_VALIDATION_MESSAGE); | 393 IDS_PAYMENTS_FIELD_REQUIRED_VALIDATION_MESSAGE); |
| 394 controller_->DisplayErrorMessageForField(field_, displayed_message); | 394 controller_->DisplayErrorMessageForField(field_, displayed_message); |
| 395 return is_required_valid; | 395 return is_required_valid; |
| 396 } | 396 } |
| 397 | 397 |
| 398 } // namespace payments | 398 } // namespace payments |
| OLD | NEW |