| 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 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_CONTACT_INFO_EDITOR_VIEW_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_CONTACT_INFO_EDITOR_VIEW_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_CONTACT_INFO_EDITOR_VIEW_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_CONTACT_INFO_EDITOR_VIEW_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> |
| 9 #include <vector> | 10 #include <vector> |
| 10 | 11 |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 12 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
| 13 #include "chrome/browser/ui/views/payments/editor_view_controller.h" | 14 #include "chrome/browser/ui/views/payments/editor_view_controller.h" |
| 14 #include "chrome/browser/ui/views/payments/validation_delegate.h" | 15 #include "chrome/browser/ui/views/payments/validation_delegate.h" |
| 15 | 16 |
| 16 namespace autofill { | 17 namespace autofill { |
| 17 class AutofillProfile; | 18 class AutofillProfile; |
| 18 } // namespace autofill | 19 } // namespace autofill |
| (...skipping 25 matching lines...) Expand all Loading... |
| 44 protected: | 45 protected: |
| 45 // PaymentRequestSheetController: | 46 // PaymentRequestSheetController: |
| 46 base::string16 GetSheetTitle() override; | 47 base::string16 GetSheetTitle() override; |
| 47 | 48 |
| 48 private: | 49 private: |
| 49 bool ValidateModel(); | 50 bool ValidateModel(); |
| 50 // Uses the values in the UI fields to populate the corresponding values in | 51 // Uses the values in the UI fields to populate the corresponding values in |
| 51 // |profile|. | 52 // |profile|. |
| 52 void PopulateProfile(autofill::AutofillProfile* profile); | 53 void PopulateProfile(autofill::AutofillProfile* profile); |
| 53 | 54 |
| 55 bool GetSheetId(DialogViewID* sheet_id) override; |
| 56 |
| 54 autofill::AutofillProfile* profile_to_edit_; | 57 autofill::AutofillProfile* profile_to_edit_; |
| 55 | 58 |
| 56 class ContactInfoValidationDelegate : public ValidationDelegate { | 59 class ContactInfoValidationDelegate : public ValidationDelegate { |
| 57 public: | 60 public: |
| 58 ContactInfoValidationDelegate(const EditorField& field, | 61 ContactInfoValidationDelegate(const EditorField& field, |
| 59 const std::string& locale, | 62 const std::string& locale, |
| 60 EditorViewController* controller); | 63 EditorViewController* controller); |
| 61 ~ContactInfoValidationDelegate() override; | 64 ~ContactInfoValidationDelegate() override; |
| 62 | 65 |
| 63 // ValidationDelegate: | 66 // ValidationDelegate: |
| 64 bool ValidateTextfield(views::Textfield* textfield) override; | 67 bool ValidateTextfield(views::Textfield* textfield) override; |
| 65 bool ValidateCombobox(views::Combobox* combobox) override; | 68 bool ValidateCombobox(views::Combobox* combobox) override; |
| 66 void ComboboxModelChanged(views::Combobox* combobox) override {} | 69 void ComboboxModelChanged(views::Combobox* combobox) override {} |
| 67 | 70 |
| 68 private: | 71 private: |
| 69 EditorField field_; | 72 EditorField field_; |
| 70 // Outlives this class. Never null. | 73 // Outlives this class. Never null. |
| 71 EditorViewController* controller_; | 74 EditorViewController* controller_; |
| 72 const std::string& locale_; | 75 const std::string& locale_; |
| 73 }; | 76 }; |
| 74 }; | 77 }; |
| 75 | 78 |
| 76 } // namespace payments | 79 } // namespace payments |
| 77 | 80 |
| 78 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_CONTACT_INFO_EDITOR_VIEW_CONTROLLER_
H_ | 81 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_CONTACT_INFO_EDITOR_VIEW_CONTROLLER_
H_ |
| OLD | NEW |