| 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 virtual bool ShouldShowProgressBar() const OVERRIDE; | 129 virtual bool ShouldShowProgressBar() const OVERRIDE; |
| 130 virtual gfx::Image ButtonStripImage() const OVERRIDE; | 130 virtual gfx::Image ButtonStripImage() const OVERRIDE; |
| 131 virtual int GetDialogButtons() const OVERRIDE; | 131 virtual int GetDialogButtons() const OVERRIDE; |
| 132 virtual bool IsDialogButtonEnabled(ui::DialogButton button) const OVERRIDE; | 132 virtual bool IsDialogButtonEnabled(ui::DialogButton button) const OVERRIDE; |
| 133 virtual DialogOverlayState GetDialogOverlay() const OVERRIDE; | 133 virtual DialogOverlayState GetDialogOverlay() const OVERRIDE; |
| 134 virtual const std::vector<ui::Range>& LegalDocumentLinks() OVERRIDE; | 134 virtual const std::vector<ui::Range>& LegalDocumentLinks() OVERRIDE; |
| 135 virtual bool SectionIsActive(DialogSection section) const OVERRIDE; | 135 virtual bool SectionIsActive(DialogSection section) const OVERRIDE; |
| 136 virtual const DetailInputs& RequestedFieldsForSection(DialogSection section) | 136 virtual const DetailInputs& RequestedFieldsForSection(DialogSection section) |
| 137 const OVERRIDE; | 137 const OVERRIDE; |
| 138 virtual ui::ComboboxModel* ComboboxModelForAutofillType( | 138 virtual ui::ComboboxModel* ComboboxModelForAutofillType( |
| 139 AutofillFieldType type) OVERRIDE; | 139 ServerFieldType type) OVERRIDE; |
| 140 virtual ui::MenuModel* MenuModelForSection(DialogSection section) OVERRIDE; | 140 virtual ui::MenuModel* MenuModelForSection(DialogSection section) OVERRIDE; |
| 141 virtual string16 LabelForSection(DialogSection section) const OVERRIDE; | 141 virtual string16 LabelForSection(DialogSection section) const OVERRIDE; |
| 142 virtual SuggestionState SuggestionStateForSection( | 142 virtual SuggestionState SuggestionStateForSection( |
| 143 DialogSection section) OVERRIDE; | 143 DialogSection section) OVERRIDE; |
| 144 virtual void EditClickedForSection(DialogSection section) OVERRIDE; | 144 virtual void EditClickedForSection(DialogSection section) OVERRIDE; |
| 145 virtual void EditCancelledForSection(DialogSection section) OVERRIDE; | 145 virtual void EditCancelledForSection(DialogSection section) OVERRIDE; |
| 146 virtual gfx::Image IconForField(AutofillFieldType type, | 146 virtual gfx::Image IconForField(ServerFieldType type, |
| 147 const string16& user_input) const OVERRIDE; | 147 const string16& user_input) const OVERRIDE; |
| 148 virtual string16 InputValidityMessage(DialogSection section, | 148 virtual string16 InputValidityMessage(DialogSection section, |
| 149 AutofillFieldType type, | 149 ServerFieldType type, |
| 150 const string16& value) OVERRIDE; | 150 const string16& value) OVERRIDE; |
| 151 virtual ValidityData InputsAreValid( | 151 virtual ValidityData InputsAreValid( |
| 152 DialogSection section, | 152 DialogSection section, |
| 153 const DetailOutputMap& inputs, | 153 const DetailOutputMap& inputs, |
| 154 ValidationType validation_type) OVERRIDE; | 154 ValidationType validation_type) OVERRIDE; |
| 155 virtual void UserEditedOrActivatedInput(DialogSection section, | 155 virtual void UserEditedOrActivatedInput(DialogSection section, |
| 156 const DetailInput* input, | 156 const DetailInput* input, |
| 157 gfx::NativeView parent_view, | 157 gfx::NativeView parent_view, |
| 158 const gfx::Rect& content_bounds, | 158 const gfx::Rect& content_bounds, |
| 159 const string16& field_contents, | 159 const string16& field_contents, |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 // Returns whether |form_structure|_| has any fields that match the fieldset | 371 // Returns whether |form_structure|_| has any fields that match the fieldset |
| 372 // represented by |section|. | 372 // represented by |section|. |
| 373 bool FormStructureCaresAboutSection(DialogSection section) const; | 373 bool FormStructureCaresAboutSection(DialogSection section) const; |
| 374 | 374 |
| 375 // Sets the CVC result on |form_structure_| to the value in |cvc|. | 375 // Sets the CVC result on |form_structure_| to the value in |cvc|. |
| 376 void SetCvcResult(const string16& cvc); | 376 void SetCvcResult(const string16& cvc); |
| 377 | 377 |
| 378 // Gets the value for |type| in |section|, whether it comes from manual user | 378 // Gets the value for |type| in |section|, whether it comes from manual user |
| 379 // input or the active suggestion. | 379 // input or the active suggestion. |
| 380 string16 GetValueFromSection(DialogSection section, | 380 string16 GetValueFromSection(DialogSection section, |
| 381 AutofillFieldType type); | 381 ServerFieldType type); |
| 382 | 382 |
| 383 // Saves the data in |profile| to the personal data manager. This may add | 383 // Saves the data in |profile| to the personal data manager. This may add |
| 384 // a new profile or tack onto an existing profile. | 384 // a new profile or tack onto an existing profile. |
| 385 void SaveProfileGleanedFromSection(const AutofillProfile& profile, | 385 void SaveProfileGleanedFromSection(const AutofillProfile& profile, |
| 386 DialogSection section); | 386 DialogSection section); |
| 387 | 387 |
| 388 // Gets the SuggestionsMenuModel for |section|. | 388 // Gets the SuggestionsMenuModel for |section|. |
| 389 SuggestionsMenuModel* SuggestionsMenuModelForSection(DialogSection section); | 389 SuggestionsMenuModel* SuggestionsMenuModelForSection(DialogSection section); |
| 390 const SuggestionsMenuModel* SuggestionsMenuModelForSection( | 390 const SuggestionsMenuModel* SuggestionsMenuModelForSection( |
| 391 DialogSection section) const; | 391 DialogSection section) const; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 403 string16 RequiredActionTextForSection(DialogSection section) const; | 403 string16 RequiredActionTextForSection(DialogSection section) const; |
| 404 gfx::Image SuggestionIconForSection(DialogSection section); | 404 gfx::Image SuggestionIconForSection(DialogSection section); |
| 405 string16 ExtraSuggestionTextForSection(DialogSection section) const; | 405 string16 ExtraSuggestionTextForSection(DialogSection section) const; |
| 406 gfx::Image ExtraSuggestionIconForSection(DialogSection section) const; | 406 gfx::Image ExtraSuggestionIconForSection(DialogSection section) const; |
| 407 | 407 |
| 408 // Loads profiles that can suggest data for |type|. |field_contents| is the | 408 // Loads profiles that can suggest data for |type|. |field_contents| is the |
| 409 // part the user has already typed. |inputs| is the rest of section. | 409 // part the user has already typed. |inputs| is the rest of section. |
| 410 // Identifying info is loaded into the last three outparams as well as | 410 // Identifying info is loaded into the last three outparams as well as |
| 411 // |popup_guids_|. | 411 // |popup_guids_|. |
| 412 void GetProfileSuggestions( | 412 void GetProfileSuggestions( |
| 413 AutofillFieldType type, | 413 ServerFieldType type, |
| 414 const string16& field_contents, | 414 const string16& field_contents, |
| 415 const DetailInputs& inputs, | 415 const DetailInputs& inputs, |
| 416 std::vector<string16>* popup_values, | 416 std::vector<string16>* popup_values, |
| 417 std::vector<string16>* popup_labels, | 417 std::vector<string16>* popup_labels, |
| 418 std::vector<string16>* popup_icons); | 418 std::vector<string16>* popup_icons); |
| 419 | 419 |
| 420 // Like RequestedFieldsForSection, but returns a pointer. | 420 // Like RequestedFieldsForSection, but returns a pointer. |
| 421 DetailInputs* MutableRequestedFieldsForSection(DialogSection section); | 421 DetailInputs* MutableRequestedFieldsForSection(DialogSection section); |
| 422 | 422 |
| 423 // Hides |popup_controller_|'s popup view, if it exists. | 423 // Hides |popup_controller_|'s popup view, if it exists. |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 // returned in |GetWalletItems()|. | 679 // returned in |GetWalletItems()|. |
| 680 bool choose_another_instrument_or_address_; | 680 bool choose_another_instrument_or_address_; |
| 681 | 681 |
| 682 // Whether or not the server side validation errors returned by Wallet were | 682 // Whether or not the server side validation errors returned by Wallet were |
| 683 // recoverable. | 683 // recoverable. |
| 684 bool wallet_server_validation_recoverable_; | 684 bool wallet_server_validation_recoverable_; |
| 685 | 685 |
| 686 // Whether |callback_| was Run() with a filled |form_structure_|. | 686 // Whether |callback_| was Run() with a filled |form_structure_|. |
| 687 bool data_was_passed_back_; | 687 bool data_was_passed_back_; |
| 688 | 688 |
| 689 typedef std::map<AutofillFieldType, | 689 typedef std::map<ServerFieldType, |
| 690 std::pair<base::string16, base::string16> > TypeErrorInputMap; | 690 std::pair<base::string16, base::string16> > TypeErrorInputMap; |
| 691 typedef std::map<DialogSection, TypeErrorInputMap> WalletValidationErrors; | 691 typedef std::map<DialogSection, TypeErrorInputMap> WalletValidationErrors; |
| 692 // Wallet validation errors. section->type->(error_msg, input_value). | 692 // Wallet validation errors. section->type->(error_msg, input_value). |
| 693 WalletValidationErrors wallet_errors_; | 693 WalletValidationErrors wallet_errors_; |
| 694 | 694 |
| 695 // The current state of the Autocheckout flow. | 695 // The current state of the Autocheckout flow. |
| 696 AutocheckoutState autocheckout_state_; | 696 AutocheckoutState autocheckout_state_; |
| 697 | 697 |
| 698 // Whether the latency to display to the UI was logged to UMA yet. | 698 // Whether the latency to display to the UI was logged to UMA yet. |
| 699 bool was_ui_latency_logged_; | 699 bool was_ui_latency_logged_; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 713 // show a bubble as the dialog closes to confirm a user's new card info was | 713 // show a bubble as the dialog closes to confirm a user's new card info was |
| 714 // saved. Never populated while incognito (as nothing's actually saved). | 714 // saved. Never populated while incognito (as nothing's actually saved). |
| 715 scoped_ptr<CreditCard> newly_saved_card_; | 715 scoped_ptr<CreditCard> newly_saved_card_; |
| 716 | 716 |
| 717 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); | 717 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); |
| 718 }; | 718 }; |
| 719 | 719 |
| 720 } // namespace autofill | 720 } // namespace autofill |
| 721 | 721 |
| 722 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ | 722 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ |
| OLD | NEW |