Index: chrome/browser/ui/autofill/autofill_dialog_controller_impl.h |
diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.h b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.h |
index 60bec1db7112520d1ad9ff553226d5e8faf173f8..6bcfdf4ee12bf2b39aa16949617b9d736fc483e2 100644 |
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.h |
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.h |
@@ -9,6 +9,7 @@ |
#include <vector> |
#include "base/callback.h" |
+#include "base/gtest_prod_util.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/memory/weak_ptr.h" |
#include "base/string16.h" |
@@ -265,10 +266,27 @@ class AutofillDialogControllerImpl : public AutofillDialogController, |
// Exposed and virtual for testing. |
virtual bool IsFirstRun() const; |
+ // Asks risk module to asynchronously load fingerprint data. Data will be |
+ // returned via |OnDidLoadRiskFingerprintData()|. Exposed for testing. |
+ virtual void LoadRiskFingerprintData(); |
+ |
// Opens the given URL in a new foreground tab. |
virtual void OpenTabWithUrl(const GURL& url); |
private: |
+ FRIEND_TEST_ALL_PREFIXES(AutofillDialogControllerTest, AcceptLegalDocuments); |
+ FRIEND_TEST_ALL_PREFIXES(AutofillDialogControllerTest, VerifyCvv); |
+ FRIEND_TEST_ALL_PREFIXES(AutofillDialogControllerTest, ErrorDuringSubmit); |
+ FRIEND_TEST_ALL_PREFIXES(AutofillDialogControllerTest, ErrorDuringVerifyCvv); |
+ FRIEND_TEST_ALL_PREFIXES(AutofillDialogControllerTest, |
+ ChangeAccountDuringSubmit); |
+ FRIEND_TEST_ALL_PREFIXES(AutofillDialogControllerTest, |
+ ChangeAccountDuringVerifyCvv); |
+ FRIEND_TEST_ALL_PREFIXES(AutofillDialogControllerTest, |
+ RiskLoadsWithoutPendingLegalDocuments); |
+ FRIEND_TEST_ALL_PREFIXES(AutofillDialogControllerTest, |
+ RiskLoadsAfterAcceptingLegalDocuments); |
Ilya Sherman
2013/05/22 22:34:24
Rather than adding lots of friend tests, please up
Dan Beam
2013/05/22 23:25:20
Done.
|
+ |
// Whether or not the current request wants credit info back. |
bool RequestingCreditCardInfo() const; |
@@ -379,9 +397,7 @@ class AutofillDialogControllerImpl : public AutofillDialogController, |
// Hides |popup_controller_|'s popup view, if it exists. |
void HidePopup(); |
- // Asks risk module to asynchronously load fingerprint data. Data will be |
- // returned via OnDidLoadRiskFingerprintData. |
- void LoadRiskFingerprintData(); |
+ // Called when loading of risk fingerprint data is done. |
void OnDidLoadRiskFingerprintData(scoped_ptr<risk::Fingerprint> fingerprint); |
// Whether the user has chosen to enter all new data in |section|. This |
@@ -417,6 +433,9 @@ class AutofillDialogControllerImpl : public AutofillDialogController, |
// or Online Wallet (|is_submitting_|) and update the view. |
void SetIsSubmitting(bool submitting); |
+ // Whether the user has accepted all the current legal documents' terms. |
+ bool LegalDocumentsAreCurrent() const; |
+ |
// Start the submit proccess to interact with Online Wallet (might do various |
// things like accept documents, save details, update details, respond to |
// required actions, etc.). |
@@ -433,10 +452,14 @@ class AutofillDialogControllerImpl : public AutofillDialogController, |
// Creates an address based on the contents of |view_|. |
scoped_ptr<wallet::Address> CreateTransientAddress(); |
- // Gets a full wallet from Online Wallet so the user can purchase something. |
+ // Gets a full wallet from Online Wallet so the user can purchase something if |
Ilya Sherman
2013/05/22 22:34:24
nit: Spurious diff.
Dan Beam
2013/05/22 23:25:20
Done.
|
// This information is decoded to reveal a fronting (proxy) card. |
void GetFullWallet(); |
+ // Calls |GetFullWallet()| if the required members (|risk_data_|, |
+ // |active_instrument_id_|, and |active_address_id_|) are populated. |
+ void GetFullWalletIfReady(); |
+ |
// Updates the state of the controller and |view_| based on any required |
// actions returned by Save or Update calls to Wallet. |
void HandleSaveOrUpdateRequiredActions( |
@@ -518,6 +541,10 @@ class AutofillDialogControllerImpl : public AutofillDialogController, |
scoped_ptr<wallet::WalletItems> wallet_items_; |
scoped_ptr<wallet::FullWallet> full_wallet_; |
+ // Local machine signals to pass along on each request to trigger (or |
+ // discourage) risk challenges; sent if the user is up to date on legal docs. |
+ std::string risk_data_; |
+ |
// The text to display when the user is accepting new terms of service, etc. |
string16 legal_documents_text_; |
// The ranges within |legal_documents_text_| to linkify. |
@@ -574,6 +601,9 @@ class AutofillDialogControllerImpl : public AutofillDialogController, |
// Whether this is the first time this profile has seen the Autofill dialog. |
bool is_first_run_; |
+ // Whether a user accepted legal documents while this dialog is running. |
+ bool accepted_legal_documents_; |
Ilya Sherman
2013/05/22 22:34:24
nit: "has_accepted_..."
Dan Beam
2013/05/22 23:25:20
Done.
|
+ |
// True after the user first accepts the dialog and presses "Submit". May |
// continue to be true while processing required actions. |
bool is_submitting_; |