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 612e24479a9a95b3c9a9096c310a5f3443b8f82c..4d817ad8ba167c61f8bf340d8ae03551d6335f17 100644 |
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.h |
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.h |
@@ -282,6 +282,15 @@ class AutofillDialogControllerImpl : public AutofillDialogViewDelegate, |
// in order to fill |form_structure_| and pass data back to the invoking page. |
void DoFinishSubmit(); |
+ // Delays enabling submit button for a short period of time. Exposed for |
+ // testing. |
+ virtual void SubmitButtonDelayBegin(); |
+ |
+ // Ends the delay for enabling the submit button. Called only from tests. |
+ // Without this method, the tests would have to wait for the delay timer to |
+ // finish, which would be flaky. |
+ void SubmitButtonDelayEndForTesting(); |
+ |
private: |
enum DialogSignedInState { |
REQUIRES_RESPONSE, |
@@ -541,6 +550,9 @@ class AutofillDialogControllerImpl : public AutofillDialogViewDelegate, |
// times an Online Wallet fronting card was generated. |
void MaybeShowCreditCardBubble(); |
+ // Called when the delay for enabling the submit button ends. |
+ void OnSubmitButtonDelayEnd(); |
+ |
// The |profile| for |contents_|. |
Profile* const profile_; |
@@ -692,6 +704,10 @@ class AutofillDialogControllerImpl : public AutofillDialogViewDelegate, |
// saved. Never populated while incognito (as nothing's actually saved). |
scoped_ptr<CreditCard> newly_saved_card_; |
+ // The timer that delays enabling submit button for a short period of time on |
+ // startup. |
+ base::OneShotTimer<AutofillDialogControllerImpl> submit_button_delay_timer_; |
+ |
DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); |
}; |