Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Side by Side Diff: chrome/browser/ui/autofill/autofill_dialog_controller_impl.h

Issue 23717029: Disable submit button briefly when launching rAc dialog (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Do not extend the submit button delay in test Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 // Shows a new credit card saved bubble and passes ownership of |new_card| and 275 // Shows a new credit card saved bubble and passes ownership of |new_card| and
276 // |billing_profile| to the bubble. Exposed for testing. 276 // |billing_profile| to the bubble. Exposed for testing.
277 virtual void ShowNewCreditCardBubble( 277 virtual void ShowNewCreditCardBubble(
278 scoped_ptr<CreditCard> new_card, 278 scoped_ptr<CreditCard> new_card,
279 scoped_ptr<AutofillProfile> billing_profile); 279 scoped_ptr<AutofillProfile> billing_profile);
280 280
281 // Called when there's nothing left to accept, update, save, or authenticate 281 // Called when there's nothing left to accept, update, save, or authenticate
282 // in order to fill |form_structure_| and pass data back to the invoking page. 282 // in order to fill |form_structure_| and pass data back to the invoking page.
283 void DoFinishSubmit(); 283 void DoFinishSubmit();
284 284
285 // Delays enabling submit button for a short period of time. Exposed for
286 // testing.
287 virtual void SubmitButtonDelayBegin();
288
289 // Ends the delay for enabling the submit button. Called only from tests.
290 // Without this method, the tests would have to wait for the delay timer to
291 // finish, which would be flaky.
292 void SubmitButtonDelayEndForTesting();
293
285 private: 294 private:
286 enum DialogSignedInState { 295 enum DialogSignedInState {
287 REQUIRES_RESPONSE, 296 REQUIRES_RESPONSE,
288 REQUIRES_SIGN_IN, 297 REQUIRES_SIGN_IN,
289 REQUIRES_PASSIVE_SIGN_IN, 298 REQUIRES_PASSIVE_SIGN_IN,
290 SIGNED_IN, 299 SIGNED_IN,
291 SIGN_IN_DISABLED, 300 SIGN_IN_DISABLED,
292 }; 301 };
293 302
294 // Whether or not the current request wants credit info back. 303 // Whether or not the current request wants credit info back.
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 void LogDialogLatencyToShow(); 543 void LogDialogLatencyToShow();
535 544
536 // Returns the metric corresponding to the user's initial state when 545 // Returns the metric corresponding to the user's initial state when
537 // interacting with this dialog. 546 // interacting with this dialog.
538 AutofillMetrics::DialogInitialUserStateMetric GetInitialUserState() const; 547 AutofillMetrics::DialogInitialUserStateMetric GetInitialUserState() const;
539 548
540 // Shows an educational bubble if a new credit card was saved or the first few 549 // Shows an educational bubble if a new credit card was saved or the first few
541 // times an Online Wallet fronting card was generated. 550 // times an Online Wallet fronting card was generated.
542 void MaybeShowCreditCardBubble(); 551 void MaybeShowCreditCardBubble();
543 552
553 // Called when the delay for enabling the submit button ends.
554 void OnSubmitButtonDelayEnd();
555
544 // The |profile| for |contents_|. 556 // The |profile| for |contents_|.
545 Profile* const profile_; 557 Profile* const profile_;
546 558
547 // For logging UMA metrics. 559 // For logging UMA metrics.
548 const AutofillMetrics metric_logger_; 560 const AutofillMetrics metric_logger_;
549 base::Time dialog_shown_timestamp_; 561 base::Time dialog_shown_timestamp_;
550 AutofillMetrics::DialogInitialUserStateMetric initial_user_state_; 562 AutofillMetrics::DialogInitialUserStateMetric initial_user_state_;
551 563
552 FormStructure form_structure_; 564 FormStructure form_structure_;
553 565
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 697
686 // The Google Wallet cookie value, set as an authorization header on requests 698 // The Google Wallet cookie value, set as an authorization header on requests
687 // to Wallet. 699 // to Wallet.
688 std::string wallet_cookie_value_; 700 std::string wallet_cookie_value_;
689 701
690 // Populated if the user chose to save a newly inputted credit card. Used to 702 // Populated if the user chose to save a newly inputted credit card. Used to
691 // show a bubble as the dialog closes to confirm a user's new card info was 703 // 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). 704 // saved. Never populated while incognito (as nothing's actually saved).
693 scoped_ptr<CreditCard> newly_saved_card_; 705 scoped_ptr<CreditCard> newly_saved_card_;
694 706
707 // The timer that delays enabling submit button for a short period of time on
708 // startup.
709 base::OneShotTimer<AutofillDialogControllerImpl> submit_button_delay_timer_;
710
695 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); 711 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl);
696 }; 712 };
697 713
698 } // namespace autofill 714 } // namespace autofill
699 715
700 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ 716 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698