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 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 const gfx::Rect& content_bounds, | 133 const gfx::Rect& content_bounds, |
134 const string16& field_contents, | 134 const string16& field_contents, |
135 bool was_edit) OVERRIDE; | 135 bool was_edit) OVERRIDE; |
136 virtual bool HandleKeyPressEventInInput( | 136 virtual bool HandleKeyPressEventInInput( |
137 const content::NativeWebKeyboardEvent& event) OVERRIDE; | 137 const content::NativeWebKeyboardEvent& event) OVERRIDE; |
138 virtual void FocusMoved() OVERRIDE; | 138 virtual void FocusMoved() OVERRIDE; |
139 virtual void ViewClosed() OVERRIDE; | 139 virtual void ViewClosed() OVERRIDE; |
140 virtual std::vector<DialogNotification> CurrentNotifications() const OVERRIDE; | 140 virtual std::vector<DialogNotification> CurrentNotifications() const OVERRIDE; |
141 virtual void StartSignInFlow() OVERRIDE; | 141 virtual void StartSignInFlow() OVERRIDE; |
142 virtual void EndSignInFlow() OVERRIDE; | 142 virtual void EndSignInFlow() OVERRIDE; |
| 143 virtual void NotificationCheckboxStateChanged(DialogNotification::Type type, |
| 144 bool checked) OVERRIDE; |
143 virtual void LegalDocumentLinkClicked(const ui::Range& range) OVERRIDE; | 145 virtual void LegalDocumentLinkClicked(const ui::Range& range) OVERRIDE; |
144 virtual void OnCancel() OVERRIDE; | 146 virtual void OnCancel() OVERRIDE; |
145 virtual void OnAccept() OVERRIDE; | 147 virtual void OnAccept() OVERRIDE; |
146 virtual Profile* profile() OVERRIDE; | 148 virtual Profile* profile() OVERRIDE; |
147 virtual content::WebContents* web_contents() OVERRIDE; | 149 virtual content::WebContents* web_contents() OVERRIDE; |
148 | 150 |
149 // AutofillPopupDelegate implementation. | 151 // AutofillPopupDelegate implementation. |
150 virtual void OnPopupShown(content::KeyboardListener* listener) OVERRIDE; | 152 virtual void OnPopupShown(content::KeyboardListener* listener) OVERRIDE; |
151 virtual void OnPopupHidden(content::KeyboardListener* listener) OVERRIDE; | 153 virtual void OnPopupHidden(content::KeyboardListener* listener) OVERRIDE; |
152 virtual void DidSelectSuggestion(int identifier) OVERRIDE; | 154 virtual void DidSelectSuggestion(int identifier) OVERRIDE; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 // for testing. | 241 // for testing. |
240 virtual wallet::WalletClient* GetWalletClient(); | 242 virtual wallet::WalletClient* GetWalletClient(); |
241 | 243 |
242 // Call to disable communication to Online Wallet for this dialog. | 244 // Call to disable communication to Online Wallet for this dialog. |
243 // Exposed for testing. | 245 // Exposed for testing. |
244 void DisableWallet(); | 246 void DisableWallet(); |
245 | 247 |
246 // Returns whether Wallet is the current data source. Exposed for testing. | 248 // Returns whether Wallet is the current data source. Exposed for testing. |
247 virtual bool IsPayingWithWallet() const; | 249 virtual bool IsPayingWithWallet() const; |
248 | 250 |
| 251 // Exposed and virtual for testing. |
| 252 virtual bool IsFirstRun() const; |
| 253 |
249 private: | 254 private: |
250 // Whether or not the current request wants credit info back. | 255 // Whether or not the current request wants credit info back. |
251 bool RequestingCreditCardInfo() const; | 256 bool RequestingCreditCardInfo() const; |
252 | 257 |
253 // Whether the information input in this dialog will be securely transmitted | 258 // Whether the information input in this dialog will be securely transmitted |
254 // to the requesting site. | 259 // to the requesting site. |
255 bool TransmissionWillBeSecure() const; | 260 bool TransmissionWillBeSecure() const; |
256 | 261 |
257 // Whether the user has ever seen this dialog before. Cancels don't count. | |
258 bool IsFirstRun() const; | |
259 | |
260 // Initializes |suggested_email_| et al. | 262 // Initializes |suggested_email_| et al. |
261 void SuggestionsUpdated(); | 263 void SuggestionsUpdated(); |
262 | 264 |
263 // Returns whether |profile| is complete, i.e. can fill out all the relevant | 265 // Returns whether |profile| is complete, i.e. can fill out all the relevant |
264 // address info. Incomplete profiles will not be displayed in the dropdown | 266 // address info. Incomplete profiles will not be displayed in the dropdown |
265 // menu. | 267 // menu. |
266 bool IsCompleteProfile(const AutofillProfile& profile); | 268 bool IsCompleteProfile(const AutofillProfile& profile); |
267 | 269 |
268 // Whether the user's wallet items have at least one address and instrument. | 270 // Whether the user's wallet items have at least one address and instrument. |
269 bool HasCompleteWallet() const; | 271 bool HasCompleteWallet() const; |
270 | 272 |
271 // Starts fetching the wallet items. | 273 // Starts fetching the wallet items from Online Wallet. |
272 void StartFetchingWalletItems(); | 274 void GetWalletItems(); |
273 | 275 |
274 // Refreshes the model on Wallet or sign-in state update. | 276 // Refreshes the model on Wallet or sign-in state update. |
275 void OnWalletOrSigninUpdate(); | 277 void OnWalletOrSigninUpdate(); |
276 | 278 |
277 // Should be called on the Wallet sign-in error. | 279 // Should be called on the Wallet sign-in error. |
278 void OnWalletSigninError(); | 280 void OnWalletSigninError(); |
279 | 281 |
280 // Calculates |legal_documents_text_| and |legal_document_link_ranges_| if | 282 // Calculates |legal_documents_text_| and |legal_document_link_ranges_| if |
281 // they have not already been calculated. | 283 // they have not already been calculated. |
282 void EnsureLegalDocumentsText(); | 284 void EnsureLegalDocumentsText(); |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 | 480 |
479 // For logging UMA metrics. | 481 // For logging UMA metrics. |
480 const AutofillMetrics metric_logger_; | 482 const AutofillMetrics metric_logger_; |
481 base::Time dialog_shown_timestamp_; | 483 base::Time dialog_shown_timestamp_; |
482 base::Time autocheckout_started_timestamp_; | 484 base::Time autocheckout_started_timestamp_; |
483 AutofillMetrics::DialogInitialUserStateMetric initial_user_state_; | 485 AutofillMetrics::DialogInitialUserStateMetric initial_user_state_; |
484 | 486 |
485 // Whether this is an Autocheckout or a requestAutocomplete dialog. | 487 // Whether this is an Autocheckout or a requestAutocomplete dialog. |
486 const DialogType dialog_type_; | 488 const DialogType dialog_type_; |
487 | 489 |
| 490 // Whether this is the first time this profile has seen the Autofill dialog. |
| 491 bool is_first_run_; |
| 492 |
488 // True after the user first accepts the dialog and presses "Submit". May | 493 // True after the user first accepts the dialog and presses "Submit". May |
489 // continue to be true while processing required actions. | 494 // continue to be true while processing required actions. |
490 bool is_submitting_; | 495 bool is_submitting_; |
491 | 496 |
492 // Whether or not an Autocheckout flow is running. | 497 // Whether or not an Autocheckout flow is running. |
493 bool autocheckout_is_running_; | 498 bool autocheckout_is_running_; |
494 | 499 |
495 // Whether or not there was an error in the Autocheckout flow. | 500 // Whether or not there was an error in the Autocheckout flow. |
496 bool had_autocheckout_error_; | 501 bool had_autocheckout_error_; |
497 | 502 |
498 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); | 503 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); |
499 }; | 504 }; |
500 | 505 |
501 } // namespace autofill | 506 } // namespace autofill |
502 | 507 |
503 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ | 508 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ |
OLD | NEW |