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 <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/gtest_prod_util.h" | |
12 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
14 #include "base/string16.h" | 15 #include "base/string16.h" |
15 #include "base/time.h" | 16 #include "base/time.h" |
16 #include "chrome/browser/ui/autofill/account_chooser_model.h" | 17 #include "chrome/browser/ui/autofill/account_chooser_model.h" |
17 #include "chrome/browser/ui/autofill/autofill_dialog_controller.h" | 18 #include "chrome/browser/ui/autofill/autofill_dialog_controller.h" |
18 #include "chrome/browser/ui/autofill/autofill_dialog_models.h" | 19 #include "chrome/browser/ui/autofill/autofill_dialog_models.h" |
19 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" | 20 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" |
20 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" | 21 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" |
21 #include "chrome/browser/ui/autofill/country_combobox_model.h" | 22 #include "chrome/browser/ui/autofill/country_combobox_model.h" |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
246 // Call to disable communication to Online Wallet for this dialog. | 247 // Call to disable communication to Online Wallet for this dialog. |
247 // Exposed for testing. | 248 // Exposed for testing. |
248 void DisableWallet(); | 249 void DisableWallet(); |
249 | 250 |
250 // Returns whether Wallet is the current data source. Exposed for testing. | 251 // Returns whether Wallet is the current data source. Exposed for testing. |
251 virtual bool IsPayingWithWallet() const; | 252 virtual bool IsPayingWithWallet() const; |
252 | 253 |
253 // Exposed and virtual for testing. | 254 // Exposed and virtual for testing. |
254 virtual bool IsFirstRun() const; | 255 virtual bool IsFirstRun() const; |
255 | 256 |
257 // Asks risk module to asynchronously load fingerprint data. Data will be | |
258 // returned via |OnDidLoadRiskFingerprintData()|. Exposed for testing. | |
259 virtual void LoadRiskFingerprintData(); | |
260 | |
261 // Basically exists for testing, which is why |fingerprint| is a pointer | |
262 // rather than const-ref (as it can be NULL this way). | |
Ilya Sherman
2013/05/03 07:38:31
This comment doesn't actually describe what the me
Dan Beam
2013/05/03 09:24:47
It has no good use outside of testing and I want t
| |
263 virtual void SerializeFingerprint(risk::Fingerprint* fingerprint, | |
264 std::string* data); | |
265 | |
256 private: | 266 private: |
267 FRIEND_TEST_ALL_PREFIXES(AutofillDialogControllerTest, | |
268 LoadRiskWhenNoLegalDocs); | |
269 | |
257 // Whether or not the current request wants credit info back. | 270 // Whether or not the current request wants credit info back. |
258 bool RequestingCreditCardInfo() const; | 271 bool RequestingCreditCardInfo() const; |
259 | 272 |
260 // Whether the information input in this dialog will be securely transmitted | 273 // Whether the information input in this dialog will be securely transmitted |
261 // to the requesting site. | 274 // to the requesting site. |
262 bool TransmissionWillBeSecure() const; | 275 bool TransmissionWillBeSecure() const; |
263 | 276 |
264 // Initializes |suggested_email_| et al. | 277 // Initializes |suggested_email_| et al. |
265 void SuggestionsUpdated(); | 278 void SuggestionsUpdated(); |
266 | 279 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
353 std::vector<string16>* popup_values, | 366 std::vector<string16>* popup_values, |
354 std::vector<string16>* popup_labels, | 367 std::vector<string16>* popup_labels, |
355 std::vector<string16>* popup_icons); | 368 std::vector<string16>* popup_icons); |
356 | 369 |
357 // Like RequestedFieldsForSection, but returns a pointer. | 370 // Like RequestedFieldsForSection, but returns a pointer. |
358 DetailInputs* MutableRequestedFieldsForSection(DialogSection section); | 371 DetailInputs* MutableRequestedFieldsForSection(DialogSection section); |
359 | 372 |
360 // Hides |popup_controller_|'s popup view, if it exists. | 373 // Hides |popup_controller_|'s popup view, if it exists. |
361 void HidePopup(); | 374 void HidePopup(); |
362 | 375 |
363 // Asks risk module to asynchronously load fingerprint data. Data will be | 376 // Called when loading of risk fingerprint data is done. |
364 // returned via OnDidLoadRiskFingerprintData. | |
365 void LoadRiskFingerprintData(); | |
366 void OnDidLoadRiskFingerprintData(scoped_ptr<risk::Fingerprint> fingerprint); | 377 void OnDidLoadRiskFingerprintData(scoped_ptr<risk::Fingerprint> fingerprint); |
367 | 378 |
368 // Whether the user has chosen to enter all new data in |section|. This | 379 // Whether the user has chosen to enter all new data in |section|. This |
369 // happens via choosing "Add a new X..." from a section's suggestion menu. | 380 // happens via choosing "Add a new X..." from a section's suggestion menu. |
370 bool IsManuallyEditingSection(DialogSection section) const; | 381 bool IsManuallyEditingSection(DialogSection section) const; |
371 | 382 |
372 // Whether the user has chosen to enter all new data in at least one section. | 383 // Whether the user has chosen to enter all new data in at least one section. |
373 bool IsManuallyEditingAnySection() const; | 384 bool IsManuallyEditingAnySection() const; |
374 | 385 |
375 // Whether all of the input fields currently showing in the dialog have valid | 386 // Whether all of the input fields currently showing in the dialog have valid |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
472 // The helper is set only during fetch/sign-in, and NULL otherwise. | 483 // The helper is set only during fetch/sign-in, and NULL otherwise. |
473 scoped_ptr<wallet::WalletSigninHelper> signin_helper_; | 484 scoped_ptr<wallet::WalletSigninHelper> signin_helper_; |
474 | 485 |
475 // A client to talk to the Online Wallet API. | 486 // A client to talk to the Online Wallet API. |
476 wallet::WalletClient wallet_client_; | 487 wallet::WalletClient wallet_client_; |
477 | 488 |
478 // Recently received items retrieved via |wallet_client_|. | 489 // Recently received items retrieved via |wallet_client_|. |
479 scoped_ptr<wallet::WalletItems> wallet_items_; | 490 scoped_ptr<wallet::WalletItems> wallet_items_; |
480 scoped_ptr<wallet::FullWallet> full_wallet_; | 491 scoped_ptr<wallet::FullWallet> full_wallet_; |
481 | 492 |
493 // Local machine signals to pass along on each request to trigger (or | |
494 // discourage) risk challenges; sent if the user's up to date on legal docs. | |
Ilya Sherman
2013/05/03 07:38:31
nit: "user's" -> "user is" IMO
Dan Beam
2013/05/03 23:02:40
Done.
| |
495 std::string risk_data_; | |
496 | |
482 // The text to display when the user is accepting new terms of service, etc. | 497 // The text to display when the user is accepting new terms of service, etc. |
483 string16 legal_documents_text_; | 498 string16 legal_documents_text_; |
484 // The ranges within |legal_documents_text_| to linkify. | 499 // The ranges within |legal_documents_text_| to linkify. |
485 std::vector<ui::Range> legal_document_link_ranges_; | 500 std::vector<ui::Range> legal_document_link_ranges_; |
486 | 501 |
487 // Used to remember the state of Wallet comboboxes when Submit was clicked. | 502 // Used to remember the state of Wallet comboboxes when Submit was clicked. |
488 std::string active_instrument_id_; | 503 std::string active_instrument_id_; |
489 std::string active_address_id_; | 504 std::string active_address_id_; |
490 | 505 |
491 // The fields for billing and shipping which the page has actually requested. | 506 // The fields for billing and shipping which the page has actually requested. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
527 scoped_ptr<AutofillDialogView> view_; | 542 scoped_ptr<AutofillDialogView> view_; |
528 | 543 |
529 // A NotificationRegistrar for tracking the completion of sign-in. | 544 // A NotificationRegistrar for tracking the completion of sign-in. |
530 content::NotificationRegistrar registrar_; | 545 content::NotificationRegistrar registrar_; |
531 | 546 |
532 base::WeakPtrFactory<AutofillDialogControllerImpl> weak_ptr_factory_; | 547 base::WeakPtrFactory<AutofillDialogControllerImpl> weak_ptr_factory_; |
533 | 548 |
534 // Whether this is the first time this profile has seen the Autofill dialog. | 549 // Whether this is the first time this profile has seen the Autofill dialog. |
535 bool is_first_run_; | 550 bool is_first_run_; |
536 | 551 |
552 // Whether a user's legal documents are up to date. | |
553 bool legal_docs_current_; | |
Ilya Sherman
2013/05/03 07:38:31
nit: "legal_docs_are_current_" or "are_legal_docs_
Dan Beam
2013/05/03 23:02:40
Done.
| |
554 | |
537 // True after the user first accepts the dialog and presses "Submit". May | 555 // True after the user first accepts the dialog and presses "Submit". May |
538 // continue to be true while processing required actions. | 556 // continue to be true while processing required actions. |
539 bool is_submitting_; | 557 bool is_submitting_; |
540 | 558 |
541 // Whether or not an Autocheckout flow is running. | 559 // Whether or not an Autocheckout flow is running. |
542 bool autocheckout_is_running_; | 560 bool autocheckout_is_running_; |
543 | 561 |
544 // Whether or not there was an error in the Autocheckout flow. | 562 // Whether or not there was an error in the Autocheckout flow. |
545 bool had_autocheckout_error_; | 563 bool had_autocheckout_error_; |
546 | 564 |
547 // Whether the latency to display to the UI was logged to UMA yet. | 565 // Whether the latency to display to the UI was logged to UMA yet. |
548 bool was_ui_latency_logged_; | 566 bool was_ui_latency_logged_; |
549 | 567 |
550 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); | 568 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); |
551 }; | 569 }; |
552 | 570 |
553 } // namespace autofill | 571 } // namespace autofill |
554 | 572 |
555 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ | 573 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ |
OLD | NEW |