| 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 DetailOutputMap& inputs) OVERRIDE; | 140 DialogSection section, const DetailOutputMap& inputs) OVERRIDE; |
| 141 virtual void UserEditedOrActivatedInput(DialogSection section, | 141 virtual void UserEditedOrActivatedInput(DialogSection section, |
| 142 const DetailInput* input, | 142 const DetailInput* input, |
| 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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 void ResetSectionInput(DialogSection section); | 352 void ResetSectionInput(DialogSection section); |
| 350 | 353 |
| 351 // Force |section| into edit mode if the current suggestion is invalid. | 354 // Force |section| into edit mode if the current suggestion is invalid. |
| 352 void ShowEditUiIfBadSuggestion(DialogSection section); | 355 void ShowEditUiIfBadSuggestion(DialogSection section); |
| 353 | 356 |
| 354 // Whether the |value| of |input| should be preserved on account change. | 357 // Whether the |value| of |input| should be preserved on account change. |
| 355 bool InputWasEdited(ServerFieldType type, | 358 bool InputWasEdited(ServerFieldType type, |
| 356 const base::string16& value); | 359 const base::string16& value); |
| 357 | 360 |
| 358 // Takes a snapshot of the newly inputted user data in |view_| (if it exists). | 361 // Takes a snapshot of the newly inputted user data in |view_| (if it exists). |
| 359 DetailOutputMap TakeUserInputSnapshot(); | 362 UserInputSnapshot TakeUserInputSnapshot(); |
| 360 | 363 |
| 361 // Fills the detail inputs from a previously taken user input snapshot. Does | 364 // Fills the detail inputs from a previously taken user input snapshot. Does |
| 362 // not update the view. | 365 // not update the view. |
| 363 void RestoreUserInputFromSnapshot(const DetailOutputMap& snapshot); | 366 void RestoreUserInputFromSnapshot(const UserInputSnapshot& snapshot); |
| 364 | 367 |
| 365 // Tells the view to update |section|. | 368 // Tells the view to update |section|. |
| 366 void UpdateSection(DialogSection section); | 369 void UpdateSection(DialogSection section); |
| 367 | 370 |
| 368 // Tells |view_| to update the validity status of its detail inputs (if | 371 // Tells |view_| to update the validity status of its detail inputs (if |
| 369 // |view_| is non-null). Currently this is used solely for highlighting | 372 // |view_| is non-null). Currently this is used solely for highlighting |
| 370 // invalid suggestions, so if no sections are based on existing data, | 373 // invalid suggestions, so if no sections are based on existing data, |
| 371 // |view_->UpdateForErrors()| is not called. | 374 // |view_->UpdateForErrors()| is not called. |
| 372 void UpdateForErrors(); | 375 void UpdateForErrors(); |
| 373 | 376 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 ServerFieldType type, | 449 ServerFieldType type, |
| 447 const string16& field_contents, | 450 const string16& field_contents, |
| 448 const DetailInputs& inputs, | 451 const DetailInputs& inputs, |
| 449 std::vector<string16>* popup_values, | 452 std::vector<string16>* popup_values, |
| 450 std::vector<string16>* popup_labels, | 453 std::vector<string16>* popup_labels, |
| 451 std::vector<string16>* popup_icons); | 454 std::vector<string16>* popup_icons); |
| 452 | 455 |
| 453 // Like RequestedFieldsForSection, but returns a pointer. | 456 // Like RequestedFieldsForSection, but returns a pointer. |
| 454 DetailInputs* MutableRequestedFieldsForSection(DialogSection section); | 457 DetailInputs* MutableRequestedFieldsForSection(DialogSection section); |
| 455 | 458 |
| 459 // Gets the country code (e.g. "US") that should be used for |section|. |
| 460 std::string GetCountryCodeForSection(DialogSection section) const; |
| 461 |
| 462 // Sets the country code that should be used for |section|. Also rebuilds this |
| 463 // section's inputs and updates the view. |
| 464 void SetCountryCodeForSection(DialogSection section, |
| 465 const std::string& country_code); |
| 466 |
| 456 // Hides |popup_controller_|'s popup view, if it exists. | 467 // Hides |popup_controller_|'s popup view, if it exists. |
| 457 void HidePopup(); | 468 void HidePopup(); |
| 458 | 469 |
| 459 // Set whether the currently editing |section| was originally based on | 470 // Set whether the currently editing |section| was originally based on |
| 460 // existing Wallet or Autofill data. | 471 // existing Wallet or Autofill data. |
| 461 void SetEditingExistingData(DialogSection section, bool editing); | 472 void SetEditingExistingData(DialogSection section, bool editing); |
| 462 | 473 |
| 463 // Whether the user has chosen to enter all new data in at least one section. | 474 // Whether the user has chosen to enter all new data in at least one section. |
| 464 bool IsManuallyEditingAnySection() const; | 475 bool IsManuallyEditingAnySection() const; |
| 465 | 476 |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 SuggestionsMenuModel suggested_cc_billing_; | 669 SuggestionsMenuModel suggested_cc_billing_; |
| 659 SuggestionsMenuModel suggested_shipping_; | 670 SuggestionsMenuModel suggested_shipping_; |
| 660 | 671 |
| 661 // |DialogSection|s that are in edit mode that are based on existing data. | 672 // |DialogSection|s that are in edit mode that are based on existing data. |
| 662 std::set<DialogSection> section_editing_state_; | 673 std::set<DialogSection> section_editing_state_; |
| 663 | 674 |
| 664 // Whether |form_structure_| has asked for any details that would indicate | 675 // Whether |form_structure_| has asked for any details that would indicate |
| 665 // we should show a shipping section. | 676 // we should show a shipping section. |
| 666 bool cares_about_shipping_; | 677 bool cares_about_shipping_; |
| 667 | 678 |
| 679 // Country codes to use when creating/filling billing or shipping inputs. |
| 680 std::string billing_country_code_; |
| 681 std::string shipping_country_code_; |
| 682 |
| 668 // The GUIDs for the currently showing unverified profiles popup. | 683 // The GUIDs for the currently showing unverified profiles popup. |
| 669 std::vector<PersonalDataManager::GUIDPair> popup_guids_; | 684 std::vector<PersonalDataManager::GUIDPair> popup_guids_; |
| 670 | 685 |
| 671 // The controller for the currently showing popup (which helps users when | 686 // The controller for the currently showing popup (which helps users when |
| 672 // they're manually filling the dialog). | 687 // they're manually filling the dialog). |
| 673 base::WeakPtr<AutofillPopupControllerImpl> popup_controller_; | 688 base::WeakPtr<AutofillPopupControllerImpl> popup_controller_; |
| 674 | 689 |
| 675 // The input for which |popup_controller_| is currently showing a popup | 690 // The input for which |popup_controller_| is currently showing a popup |
| 676 // (if any). | 691 // (if any). |
| 677 const DetailInput* input_showing_popup_; | 692 const DetailInput* input_showing_popup_; |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 | 773 |
| 759 // A username string we display in the card scrambling/generated overlay. | 774 // A username string we display in the card scrambling/generated overlay. |
| 760 base::string16 submitted_cardholder_name_; | 775 base::string16 submitted_cardholder_name_; |
| 761 | 776 |
| 762 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); | 777 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); |
| 763 }; | 778 }; |
| 764 | 779 |
| 765 } // namespace autofill | 780 } // namespace autofill |
| 766 | 781 |
| 767 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ | 782 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ |
| OLD | NEW |