| 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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 | 293 |
| 294 // Delays enabling submit button for a short period of time. Exposed for | 294 // Delays enabling submit button for a short period of time. Exposed for |
| 295 // testing. | 295 // testing. |
| 296 virtual void SubmitButtonDelayBegin(); | 296 virtual void SubmitButtonDelayBegin(); |
| 297 | 297 |
| 298 // Ends the delay for enabling the submit button. Called only from tests. | 298 // Ends the delay for enabling the submit button. Called only from tests. |
| 299 // Without this method, the tests would have to wait for the delay timer to | 299 // Without this method, the tests would have to wait for the delay timer to |
| 300 // finish, which would be flaky. | 300 // finish, which would be flaky. |
| 301 void SubmitButtonDelayEndForTesting(); | 301 void SubmitButtonDelayEndForTesting(); |
| 302 | 302 |
| 303 // Resets |last_wallet_items_fetch_timestamp_| for testing. |
| 304 void ClearLastWalletItemsFetchTimestampForTesting(); |
| 305 |
| 303 private: | 306 private: |
| 304 enum DialogSignedInState { | 307 enum DialogSignedInState { |
| 305 REQUIRES_RESPONSE, | 308 REQUIRES_RESPONSE, |
| 306 REQUIRES_SIGN_IN, | 309 REQUIRES_SIGN_IN, |
| 307 REQUIRES_PASSIVE_SIGN_IN, | 310 REQUIRES_PASSIVE_SIGN_IN, |
| 308 SIGNED_IN, | 311 SIGNED_IN, |
| 309 SIGN_IN_DISABLED, | 312 SIGN_IN_DISABLED, |
| 310 }; | 313 }; |
| 311 | 314 |
| 312 // Whether or not the current request wants credit info back. | 315 // Whether or not the current request wants credit info back. |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 // interacting with this dialog. | 554 // interacting with this dialog. |
| 552 AutofillMetrics::DialogInitialUserStateMetric GetInitialUserState() const; | 555 AutofillMetrics::DialogInitialUserStateMetric GetInitialUserState() const; |
| 553 | 556 |
| 554 // Shows an educational bubble if a new credit card was saved or the first few | 557 // Shows an educational bubble if a new credit card was saved or the first few |
| 555 // times an Online Wallet fronting card was generated. | 558 // times an Online Wallet fronting card was generated. |
| 556 void MaybeShowCreditCardBubble(); | 559 void MaybeShowCreditCardBubble(); |
| 557 | 560 |
| 558 // Called when the delay for enabling the submit button ends. | 561 // Called when the delay for enabling the submit button ends. |
| 559 void OnSubmitButtonDelayEnd(); | 562 void OnSubmitButtonDelayEnd(); |
| 560 | 563 |
| 564 // Initiates a fetch of the user's current Wallet cookie and Google username. |
| 565 void FetchWalletCookieAndUserName(); |
| 566 |
| 561 // The |profile| for |contents_|. | 567 // The |profile| for |contents_|. |
| 562 Profile* const profile_; | 568 Profile* const profile_; |
| 563 | 569 |
| 564 // For logging UMA metrics. | 570 // For logging UMA metrics. |
| 565 const AutofillMetrics metric_logger_; | 571 const AutofillMetrics metric_logger_; |
| 566 base::Time dialog_shown_timestamp_; | 572 base::Time dialog_shown_timestamp_; |
| 567 AutofillMetrics::DialogInitialUserStateMetric initial_user_state_; | 573 AutofillMetrics::DialogInitialUserStateMetric initial_user_state_; |
| 568 | 574 |
| 569 FormStructure form_structure_; | 575 FormStructure form_structure_; |
| 570 | 576 |
| 571 // Whether the URL visible to the user when this dialog was requested to be | 577 // Whether the URL visible to the user when this dialog was requested to be |
| 572 // invoked is the same as |source_url_|. | 578 // invoked is the same as |source_url_|. |
| 573 bool invoked_from_same_origin_; | 579 bool invoked_from_same_origin_; |
| 574 | 580 |
| 575 // The URL of the invoking site. | 581 // The URL of the invoking site. |
| 576 GURL source_url_; | 582 GURL source_url_; |
| 577 | 583 |
| 578 // The callback via which we return the collected data. | 584 // The callback via which we return the collected data. |
| 579 base::Callback<void(const FormStructure*)> callback_; | 585 base::Callback<void(const FormStructure*)> callback_; |
| 580 | 586 |
| 581 // The AccountChooserModel acts as the MenuModel for the account chooser, | 587 // The AccountChooserModel acts as the MenuModel for the account chooser, |
| 582 // and also tracks which data source the dialog is using. | 588 // and also tracks which data source the dialog is using. |
| 583 AccountChooserModel account_chooser_model_; | 589 AccountChooserModel account_chooser_model_; |
| 584 | 590 |
| 585 // The sign-in helper to fetch the user info and perform passive sign-in. | 591 // The sign-in helper to fetch the user's Wallet cookie and to perform passive |
| 586 // The helper is set only during fetch/sign-in, and NULL otherwise. | 592 // sign-in. The helper is set only during fetch/sign-in, and NULL otherwise. |
| 587 scoped_ptr<wallet::WalletSigninHelper> signin_helper_; | 593 scoped_ptr<wallet::WalletSigninHelper> signin_helper_; |
| 588 | 594 |
| 595 // The sign-in helper to fetch the user's human-readable username. The helper |
| 596 // is set only while fetching the username, and NULL otherwise. |
| 597 scoped_ptr<wallet::WalletSigninHelper> username_fetcher_; |
| 598 |
| 589 // A client to talk to the Online Wallet API. | 599 // A client to talk to the Online Wallet API. |
| 590 wallet::WalletClient wallet_client_; | 600 wallet::WalletClient wallet_client_; |
| 591 | 601 |
| 592 // Recently received items retrieved via |wallet_client_|. | 602 // Recently received items retrieved via |wallet_client_|. |
| 593 scoped_ptr<wallet::WalletItems> wallet_items_; | 603 scoped_ptr<wallet::WalletItems> wallet_items_; |
| 594 scoped_ptr<wallet::FullWallet> full_wallet_; | 604 scoped_ptr<wallet::FullWallet> full_wallet_; |
| 595 | 605 |
| 596 // The default active instrument and shipping address object IDs as of the | 606 // The default active instrument and shipping address object IDs as of the |
| 597 // last time Wallet items were fetched. These variables are only set | 607 // last time Wallet items were fetched. These variables are only set |
| 598 // (i.e. non-empty) when the Wallet items are being re-fetched. | 608 // (i.e. non-empty) when the Wallet items are being re-fetched. |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 731 | 741 |
| 732 // A username string we display in the card scrambling/generated overlay. | 742 // A username string we display in the card scrambling/generated overlay. |
| 733 base::string16 submitted_cardholder_name_; | 743 base::string16 submitted_cardholder_name_; |
| 734 | 744 |
| 735 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); | 745 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); |
| 736 }; | 746 }; |
| 737 | 747 |
| 738 } // namespace autofill | 748 } // namespace autofill |
| 739 | 749 |
| 740 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ | 750 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ |
| OLD | NEW |