OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ | 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ |
6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ | 6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 virtual ValidityMessages InputsAreValid( | 139 virtual ValidityMessages InputsAreValid( |
140 DialogSection section, const FieldValueMap& inputs) OVERRIDE; | 140 DialogSection section, const FieldValueMap& inputs) OVERRIDE; |
141 virtual void UserEditedOrActivatedInput(DialogSection section, | 141 virtual void UserEditedOrActivatedInput(DialogSection section, |
142 ServerFieldType type, | 142 ServerFieldType type, |
143 gfx::NativeView parent_view, | 143 gfx::NativeView parent_view, |
144 const gfx::Rect& content_bounds, | 144 const gfx::Rect& content_bounds, |
145 const string16& field_contents, | 145 const string16& field_contents, |
146 bool was_edit) OVERRIDE; | 146 bool was_edit) OVERRIDE; |
147 virtual bool HandleKeyPressEventInInput( | 147 virtual bool HandleKeyPressEventInInput( |
148 const content::NativeWebKeyboardEvent& event) OVERRIDE; | 148 const content::NativeWebKeyboardEvent& event) OVERRIDE; |
| 149 virtual void ComboboxItemSelected(ui::ComboboxModel* model, |
| 150 DialogSection section, |
| 151 int index) OVERRIDE; |
149 virtual void FocusMoved() OVERRIDE; | 152 virtual void FocusMoved() OVERRIDE; |
150 virtual bool ShouldShowErrorBubble() const OVERRIDE; | 153 virtual bool ShouldShowErrorBubble() const OVERRIDE; |
151 virtual void ViewClosed() OVERRIDE; | 154 virtual void ViewClosed() OVERRIDE; |
152 virtual std::vector<DialogNotification> CurrentNotifications() OVERRIDE; | 155 virtual std::vector<DialogNotification> CurrentNotifications() OVERRIDE; |
153 virtual void LinkClicked(const GURL& url) OVERRIDE; | 156 virtual void LinkClicked(const GURL& url) OVERRIDE; |
154 virtual void SignInLinkClicked() OVERRIDE; | 157 virtual void SignInLinkClicked() OVERRIDE; |
155 virtual void NotificationCheckboxStateChanged(DialogNotification::Type type, | 158 virtual void NotificationCheckboxStateChanged(DialogNotification::Type type, |
156 bool checked) OVERRIDE; | 159 bool checked) OVERRIDE; |
157 virtual void LegalDocumentLinkClicked(const gfx::Range& range) OVERRIDE; | 160 virtual void LegalDocumentLinkClicked(const gfx::Range& range) OVERRIDE; |
158 virtual bool OnCancel() OVERRIDE; | 161 virtual bool OnCancel() OVERRIDE; |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 ServerFieldType type, | 450 ServerFieldType type, |
448 const string16& field_contents, | 451 const string16& field_contents, |
449 const DetailInputs& inputs, | 452 const DetailInputs& inputs, |
450 std::vector<string16>* popup_values, | 453 std::vector<string16>* popup_values, |
451 std::vector<string16>* popup_labels, | 454 std::vector<string16>* popup_labels, |
452 std::vector<string16>* popup_icons); | 455 std::vector<string16>* popup_icons); |
453 | 456 |
454 // Like RequestedFieldsForSection, but returns a pointer. | 457 // Like RequestedFieldsForSection, but returns a pointer. |
455 DetailInputs* MutableRequestedFieldsForSection(DialogSection section); | 458 DetailInputs* MutableRequestedFieldsForSection(DialogSection section); |
456 | 459 |
| 460 // Gets the country code (e.g. "US") that should be used for |section|. |
| 461 std::string GetCountryCodeForSection(DialogSection section) const; |
| 462 |
| 463 // Sets the country code that should be used for |section|. Also rebuilds this |
| 464 // section's inputs and updates the view. |
| 465 void SetCountryCodeForSection(DialogSection section, |
| 466 const std::string& country_code); |
| 467 |
457 // Hides |popup_controller_|'s popup view, if it exists. | 468 // Hides |popup_controller_|'s popup view, if it exists. |
458 void HidePopup(); | 469 void HidePopup(); |
459 | 470 |
460 // Set whether the currently editing |section| was originally based on | 471 // Set whether the currently editing |section| was originally based on |
461 // existing Wallet or Autofill data. | 472 // existing Wallet or Autofill data. |
462 void SetEditingExistingData(DialogSection section, bool editing); | 473 void SetEditingExistingData(DialogSection section, bool editing); |
463 | 474 |
464 // Whether the user has chosen to enter all new data in at least one section. | 475 // Whether the user has chosen to enter all new data in at least one section. |
465 bool IsManuallyEditingAnySection() const; | 476 bool IsManuallyEditingAnySection() const; |
466 | 477 |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 SuggestionsMenuModel suggested_cc_billing_; | 674 SuggestionsMenuModel suggested_cc_billing_; |
664 SuggestionsMenuModel suggested_shipping_; | 675 SuggestionsMenuModel suggested_shipping_; |
665 | 676 |
666 // |DialogSection|s that are in edit mode that are based on existing data. | 677 // |DialogSection|s that are in edit mode that are based on existing data. |
667 std::set<DialogSection> section_editing_state_; | 678 std::set<DialogSection> section_editing_state_; |
668 | 679 |
669 // Whether |form_structure_| has asked for any details that would indicate | 680 // Whether |form_structure_| has asked for any details that would indicate |
670 // we should show a shipping section. | 681 // we should show a shipping section. |
671 bool cares_about_shipping_; | 682 bool cares_about_shipping_; |
672 | 683 |
| 684 // Country codes to use when creating/filling billing or shipping inputs. |
| 685 std::string billing_country_code_; |
| 686 std::string shipping_country_code_; |
| 687 |
673 // The GUIDs for the currently showing unverified profiles popup. | 688 // The GUIDs for the currently showing unverified profiles popup. |
674 std::vector<PersonalDataManager::GUIDPair> popup_guids_; | 689 std::vector<PersonalDataManager::GUIDPair> popup_guids_; |
675 | 690 |
676 // The controller for the currently showing popup (which helps users when | 691 // The controller for the currently showing popup (which helps users when |
677 // they're manually filling the dialog). | 692 // they're manually filling the dialog). |
678 base::WeakPtr<AutofillPopupControllerImpl> popup_controller_; | 693 base::WeakPtr<AutofillPopupControllerImpl> popup_controller_; |
679 | 694 |
680 // The input for which |popup_controller_| is currently showing a popup | 695 // The input for which |popup_controller_| is currently showing a popup |
681 // (if any). | 696 // (if any). |
682 const DetailInput* input_showing_popup_; | 697 const DetailInput* input_showing_popup_; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 | 778 |
764 // A username string we display in the card scrambling/generated overlay. | 779 // A username string we display in the card scrambling/generated overlay. |
765 base::string16 submitted_cardholder_name_; | 780 base::string16 submitted_cardholder_name_; |
766 | 781 |
767 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); | 782 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); |
768 }; | 783 }; |
769 | 784 |
770 } // namespace autofill | 785 } // namespace autofill |
771 | 786 |
772 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ | 787 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ |
OLD | NEW |