| 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/credit_card_editor_view_controller.h" | 5 #include "chrome/browser/ui/views/payments/credit_card_editor_view_controller.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| 11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
| 12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 14 #include "chrome/browser/ui/views/payments/payment_request_dialog_view.h" | 14 #include "chrome/browser/ui/views/payments/payment_request_dialog_view.h" |
| 15 #include "chrome/browser/ui/views/payments/payment_request_views_util.h" | 15 #include "chrome/browser/ui/views/payments/payment_request_views_util.h" |
| 16 #include "chrome/browser/ui/views/payments/preselected_combobox_model.h" | 16 #include "chrome/browser/ui/views/payments/preselected_combobox_model.h" |
| 17 #include "chrome/browser/ui/views/payments/validating_combobox.h" | 17 #include "chrome/browser/ui/views/payments/validating_combobox.h" |
| 18 #include "chrome/browser/ui/views/payments/validating_textfield.h" | 18 #include "chrome/browser/ui/views/payments/validating_textfield.h" |
| 19 #include "chrome/grit/generated_resources.h" | 19 #include "chrome/grit/generated_resources.h" |
| 20 #include "components/autofill/core/browser/autofill_data_util.h" | 20 #include "components/autofill/core/browser/autofill_data_util.h" |
| 21 #include "components/autofill/core/browser/autofill_type.h" | 21 #include "components/autofill/core/browser/autofill_type.h" |
| 22 #include "components/autofill/core/browser/credit_card.h" | 22 #include "components/autofill/core/browser/credit_card.h" |
| 23 #include "components/autofill/core/browser/field_types.h" | 23 #include "components/autofill/core/browser/field_types.h" |
| 24 #include "components/autofill/core/browser/personal_data_manager.h" |
| 24 #include "components/autofill/core/browser/validation.h" | 25 #include "components/autofill/core/browser/validation.h" |
| 25 #include "components/autofill/core/common/autofill_clock.h" | 26 #include "components/autofill/core/common/autofill_clock.h" |
| 26 #include "components/autofill/core/common/autofill_constants.h" | 27 #include "components/autofill/core/common/autofill_constants.h" |
| 27 #include "components/payments/payment_request.h" | 28 #include "components/payments/content/payment_request.h" |
| 28 #include "components/strings/grit/components_strings.h" | 29 #include "components/strings/grit/components_strings.h" |
| 29 #include "ui/base/l10n/l10n_util.h" | 30 #include "ui/base/l10n/l10n_util.h" |
| 30 #include "ui/native_theme/native_theme.h" | 31 #include "ui/native_theme/native_theme.h" |
| 31 #include "ui/views/controls/image_view.h" | 32 #include "ui/views/controls/image_view.h" |
| 32 #include "ui/views/controls/label.h" | 33 #include "ui/views/controls/label.h" |
| 33 #include "ui/views/controls/textfield/textfield.h" | 34 #include "ui/views/controls/textfield/textfield.h" |
| 34 #include "ui/views/layout/box_layout.h" | 35 #include "ui/views/layout/box_layout.h" |
| 35 #include "ui/views/view.h" | 36 #include "ui/views/view.h" |
| 36 | 37 |
| 37 namespace payments { | 38 namespace payments { |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 bool is_required_valid = !field_.required; | 259 bool is_required_valid = !field_.required; |
| 259 const base::string16 displayed_message = | 260 const base::string16 displayed_message = |
| 260 is_required_valid ? base::ASCIIToUTF16("") | 261 is_required_valid ? base::ASCIIToUTF16("") |
| 261 : l10n_util::GetStringUTF16( | 262 : l10n_util::GetStringUTF16( |
| 262 IDS_PAYMENTS_FIELD_REQUIRED_VALIDATION_MESSAGE); | 263 IDS_PAYMENTS_FIELD_REQUIRED_VALIDATION_MESSAGE); |
| 263 controller_->DisplayErrorMessageForField(field_, displayed_message); | 264 controller_->DisplayErrorMessageForField(field_, displayed_message); |
| 264 return is_required_valid; | 265 return is_required_valid; |
| 265 } | 266 } |
| 266 | 267 |
| 267 } // namespace payments | 268 } // namespace payments |
| OLD | NEW |