| 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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 REQUIRES_RESPONSE, | 287 REQUIRES_RESPONSE, |
| 288 REQUIRES_SIGN_IN, | 288 REQUIRES_SIGN_IN, |
| 289 REQUIRES_PASSIVE_SIGN_IN, | 289 REQUIRES_PASSIVE_SIGN_IN, |
| 290 SIGNED_IN, | 290 SIGNED_IN, |
| 291 SIGN_IN_DISABLED, | 291 SIGN_IN_DISABLED, |
| 292 }; | 292 }; |
| 293 | 293 |
| 294 // Whether or not the current request wants credit info back. | 294 // Whether or not the current request wants credit info back. |
| 295 bool RequestingCreditCardInfo() const; | 295 bool RequestingCreditCardInfo() const; |
| 296 | 296 |
| 297 // Initializes or updates |suggested_email_| et al. | 297 // Initializes or updates |suggested_cc_| et al. |
| 298 void SuggestionsUpdated(); | 298 void SuggestionsUpdated(); |
| 299 | 299 |
| 300 // Whether the user's wallet items have at least one address and instrument. | 300 // Whether the user's wallet items have at least one address and instrument. |
| 301 bool HasCompleteWallet() const; | 301 bool HasCompleteWallet() const; |
| 302 | 302 |
| 303 // Starts fetching the wallet items from Online Wallet. | 303 // Starts fetching the wallet items from Online Wallet. |
| 304 void GetWalletItems(); | 304 void GetWalletItems(); |
| 305 | 305 |
| 306 // Stop showing sign in flow. | 306 // Stop showing sign in flow. |
| 307 void HideSignIn(); | 307 void HideSignIn(); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 void FillOutputForSection(DialogSection section); | 367 void FillOutputForSection(DialogSection section); |
| 368 // As above, but uses |compare| to determine whether a DetailInput matches | 368 // As above, but uses |compare| to determine whether a DetailInput matches |
| 369 // a field. Saves any new Autofill data to the PersonalDataManager. | 369 // a field. Saves any new Autofill data to the PersonalDataManager. |
| 370 void FillOutputForSectionWithComparator(DialogSection section, | 370 void FillOutputForSectionWithComparator(DialogSection section, |
| 371 const InputFieldComparator& compare); | 371 const InputFieldComparator& compare); |
| 372 | 372 |
| 373 // Returns whether |form_structure|_| has any fields that match the fieldset | 373 // Returns whether |form_structure|_| has any fields that match the fieldset |
| 374 // represented by |section|. | 374 // represented by |section|. |
| 375 bool FormStructureCaresAboutSection(DialogSection section) const; | 375 bool FormStructureCaresAboutSection(DialogSection section) const; |
| 376 | 376 |
| 377 // Sets the CVC result on |form_structure_| to the value in |cvc|. | 377 // Finds all fields of the given |type| in |form_structure_|, if any, and sets |
| 378 void SetCvcResult(const string16& cvc); | 378 // each field's value to |output|. |
| 379 void SetOutputForFieldsOfType(ServerFieldType type, const string16& output); |
| 379 | 380 |
| 380 // Gets the value for |type| in |section|, whether it comes from manual user | 381 // Gets the value for |type| in |section|, whether it comes from manual user |
| 381 // input or the active suggestion. | 382 // input or the active suggestion. |
| 382 string16 GetValueFromSection(DialogSection section, | 383 string16 GetValueFromSection(DialogSection section, |
| 383 ServerFieldType type); | 384 ServerFieldType type); |
| 384 | 385 |
| 385 // Saves the data in |profile| to the personal data manager. This may add | 386 // Saves the data in |profile| to the personal data manager. This may add |
| 386 // a new profile or tack onto an existing profile. | 387 // a new profile or tack onto an existing profile. |
| 387 void SaveProfileGleanedFromSection(const AutofillProfile& profile, | 388 void SaveProfileGleanedFromSection(const AutofillProfile& profile, |
| 388 DialogSection section); | 389 DialogSection section); |
| 389 | 390 |
| 390 // Gets the SuggestionsMenuModel for |section|. | 391 // Gets the SuggestionsMenuModel for |section|. |
| 391 SuggestionsMenuModel* SuggestionsMenuModelForSection(DialogSection section); | 392 SuggestionsMenuModel* SuggestionsMenuModelForSection(DialogSection section); |
| 392 const SuggestionsMenuModel* SuggestionsMenuModelForSection( | 393 const SuggestionsMenuModel* SuggestionsMenuModelForSection( |
| 393 DialogSection section) const; | 394 DialogSection section) const; |
| 394 // And the reverse. | 395 // And the reverse. |
| 395 DialogSection SectionForSuggestionsMenuModel( | 396 DialogSection SectionForSuggestionsMenuModel( |
| 396 const SuggestionsMenuModel& model); | 397 const SuggestionsMenuModel& model); |
| 397 | 398 |
| 398 // Suggested text and icons for sections. Suggestion text is used to show an | 399 // Suggested text and icons for sections. Suggestion text is used to show an |
| 399 // abidged overview of the currently used suggestion. Extra text is used when | 400 // abridged overview of the currently used suggestion. Extra text is used when |
| 400 // part of a section is suggested but part must be manually input (e.g. during | 401 // part of a section is suggested but part must be manually input (e.g. during |
| 401 // a CVC challenge or when using Autofill's CC section [never stores CVC]). | 402 // a CVC challenge or when using Autofill's CC section [never stores CVC]). |
| 402 bool SuggestionTextForSection(DialogSection section, | 403 bool SuggestionTextForSection(DialogSection section, |
| 403 base::string16* vertically_compact, | 404 base::string16* vertically_compact, |
| 404 base::string16* horizontally_compact); | 405 base::string16* horizontally_compact); |
| 405 string16 RequiredActionTextForSection(DialogSection section) const; | 406 string16 RequiredActionTextForSection(DialogSection section) const; |
| 406 gfx::Image SuggestionIconForSection(DialogSection section); | 407 gfx::Image SuggestionIconForSection(DialogSection section); |
| 407 string16 ExtraSuggestionTextForSection(DialogSection section) const; | 408 string16 ExtraSuggestionTextForSection(DialogSection section) const; |
| 408 gfx::Image ExtraSuggestionIconForSection(DialogSection section) const; | 409 gfx::Image ExtraSuggestionIconForSection(DialogSection section) const; |
| 409 | 410 |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 string16 legal_documents_text_; | 595 string16 legal_documents_text_; |
| 595 // The ranges within |legal_documents_text_| to linkify. | 596 // The ranges within |legal_documents_text_| to linkify. |
| 596 std::vector<ui::Range> legal_document_link_ranges_; | 597 std::vector<ui::Range> legal_document_link_ranges_; |
| 597 | 598 |
| 598 // The instrument and address IDs from the Online Wallet server to be used | 599 // The instrument and address IDs from the Online Wallet server to be used |
| 599 // when getting a full wallet. | 600 // when getting a full wallet. |
| 600 std::string active_instrument_id_; | 601 std::string active_instrument_id_; |
| 601 std::string active_address_id_; | 602 std::string active_address_id_; |
| 602 | 603 |
| 603 // The fields for billing and shipping which the page has actually requested. | 604 // The fields for billing and shipping which the page has actually requested. |
| 604 DetailInputs requested_email_fields_; | |
| 605 DetailInputs requested_cc_fields_; | 605 DetailInputs requested_cc_fields_; |
| 606 DetailInputs requested_billing_fields_; | 606 DetailInputs requested_billing_fields_; |
| 607 DetailInputs requested_cc_billing_fields_; | 607 DetailInputs requested_cc_billing_fields_; |
| 608 DetailInputs requested_shipping_fields_; | 608 DetailInputs requested_shipping_fields_; |
| 609 | 609 |
| 610 // Models for the credit card expiration inputs. | 610 // Models for the credit card expiration inputs. |
| 611 MonthComboboxModel cc_exp_month_combobox_model_; | 611 MonthComboboxModel cc_exp_month_combobox_model_; |
| 612 YearComboboxModel cc_exp_year_combobox_model_; | 612 YearComboboxModel cc_exp_year_combobox_model_; |
| 613 | 613 |
| 614 // Model for the country input. | 614 // Model for the country input. |
| 615 CountryComboboxModel country_combobox_model_; | 615 CountryComboboxModel country_combobox_model_; |
| 616 | 616 |
| 617 // Models for the suggestion views. | 617 // Models for the suggestion views. |
| 618 SuggestionsMenuModel suggested_email_; | |
| 619 SuggestionsMenuModel suggested_cc_; | 618 SuggestionsMenuModel suggested_cc_; |
| 620 SuggestionsMenuModel suggested_billing_; | 619 SuggestionsMenuModel suggested_billing_; |
| 621 SuggestionsMenuModel suggested_cc_billing_; | 620 SuggestionsMenuModel suggested_cc_billing_; |
| 622 SuggestionsMenuModel suggested_shipping_; | 621 SuggestionsMenuModel suggested_shipping_; |
| 623 | 622 |
| 624 // |DialogSection|s that are in edit mode that are based on existing data. | 623 // |DialogSection|s that are in edit mode that are based on existing data. |
| 625 std::set<DialogSection> section_editing_state_; | 624 std::set<DialogSection> section_editing_state_; |
| 626 | 625 |
| 627 // Whether |form_structure_| has asked for any details that would indicate | 626 // Whether |form_structure_| has asked for any details that would indicate |
| 628 // we should show a shipping section. | 627 // we should show a shipping section. |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 // show a bubble as the dialog closes to confirm a user's new card info was | 690 // show a bubble as the dialog closes to confirm a user's new card info was |
| 692 // saved. Never populated while incognito (as nothing's actually saved). | 691 // saved. Never populated while incognito (as nothing's actually saved). |
| 693 scoped_ptr<CreditCard> newly_saved_card_; | 692 scoped_ptr<CreditCard> newly_saved_card_; |
| 694 | 693 |
| 695 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); | 694 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); |
| 696 }; | 695 }; |
| 697 | 696 |
| 698 } // namespace autofill | 697 } // namespace autofill |
| 699 | 698 |
| 700 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ | 699 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ |
| OLD | NEW |