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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/string16.h" | 12 #include "base/string16.h" |
| 13 #include "base/time.h" |
| 14 #include "chrome/browser/autofill/autofill_manager_delegate.h" |
| 15 #include "chrome/browser/autofill/autofill_metrics.h" |
13 #include "chrome/browser/autofill/field_types.h" | 16 #include "chrome/browser/autofill/field_types.h" |
14 #include "chrome/browser/autofill/form_structure.h" | 17 #include "chrome/browser/autofill/form_structure.h" |
15 #include "chrome/browser/autofill/personal_data_manager.h" | 18 #include "chrome/browser/autofill/personal_data_manager.h" |
16 #include "chrome/browser/autofill/wallet/required_action.h" | 19 #include "chrome/browser/autofill/wallet/required_action.h" |
17 #include "chrome/browser/autofill/wallet/wallet_client.h" | 20 #include "chrome/browser/autofill/wallet/wallet_client.h" |
18 #include "chrome/browser/autofill/wallet/wallet_client_observer.h" | 21 #include "chrome/browser/autofill/wallet/wallet_client_observer.h" |
19 #include "chrome/browser/ui/autofill/autofill_dialog_controller.h" | 22 #include "chrome/browser/ui/autofill/autofill_dialog_controller.h" |
20 #include "chrome/browser/ui/autofill/autofill_dialog_models.h" | 23 #include "chrome/browser/ui/autofill/autofill_dialog_models.h" |
21 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" | 24 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" |
22 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" | 25 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" |
(...skipping 22 matching lines...) Expand all Loading... |
45 public AutofillPopupDelegate, | 48 public AutofillPopupDelegate, |
46 public content::NotificationObserver, | 49 public content::NotificationObserver, |
47 public SuggestionsMenuModelDelegate, | 50 public SuggestionsMenuModelDelegate, |
48 public wallet::WalletClientObserver { | 51 public wallet::WalletClientObserver { |
49 public: | 52 public: |
50 AutofillDialogControllerImpl( | 53 AutofillDialogControllerImpl( |
51 content::WebContents* contents, | 54 content::WebContents* contents, |
52 const FormData& form_structure, | 55 const FormData& form_structure, |
53 const GURL& source_url, | 56 const GURL& source_url, |
54 const content::SSLStatus& ssl_status, | 57 const content::SSLStatus& ssl_status, |
| 58 const AutofillMetrics& metric_logger, |
| 59 const DialogRequester requester, |
55 const base::Callback<void(const FormStructure*)>& callback); | 60 const base::Callback<void(const FormStructure*)>& callback); |
56 virtual ~AutofillDialogControllerImpl(); | 61 virtual ~AutofillDialogControllerImpl(); |
57 | 62 |
58 void Show(); | 63 void Show(); |
59 void Hide(); | 64 void Hide(); |
60 | 65 |
61 // AutofillDialogController implementation. | 66 // AutofillDialogController implementation. |
62 virtual string16 DialogTitle() const OVERRIDE; | 67 virtual string16 DialogTitle() const OVERRIDE; |
63 virtual string16 EditSuggestionText() const OVERRIDE; | 68 virtual string16 EditSuggestionText() const OVERRIDE; |
64 virtual string16 UseBillingForShippingText() const OVERRIDE; | 69 virtual string16 UseBillingForShippingText() const OVERRIDE; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 const std::string& address_id) OVERRIDE; | 137 const std::string& address_id) OVERRIDE; |
133 virtual void OnDidSendAutocheckoutStatus() OVERRIDE; | 138 virtual void OnDidSendAutocheckoutStatus() OVERRIDE; |
134 virtual void OnWalletError() OVERRIDE; | 139 virtual void OnWalletError() OVERRIDE; |
135 virtual void OnMalformedResponse() OVERRIDE; | 140 virtual void OnMalformedResponse() OVERRIDE; |
136 virtual void OnNetworkError(int response_code) OVERRIDE; | 141 virtual void OnNetworkError(int response_code) OVERRIDE; |
137 | 142 |
138 // Updates the progress bar based on the Autocheckout progress. |value| should | 143 // Updates the progress bar based on the Autocheckout progress. |value| should |
139 // be in [0.0, 1.0]. | 144 // be in [0.0, 1.0]. |
140 void UpdateProgressBar(double value); | 145 void UpdateProgressBar(double value); |
141 | 146 |
| 147 protected: |
| 148 // Exposed for testing. |
| 149 AutofillDialogView* view() { return view_.get(); } |
| 150 |
142 private: | 151 private: |
143 // Determines whether |input| and |field| match. | 152 // Determines whether |input| and |field| match. |
144 typedef base::Callback<bool(const DetailInput& input, | 153 typedef base::Callback<bool(const DetailInput& input, |
145 const AutofillField& field)> InputFieldComparator; | 154 const AutofillField& field)> InputFieldComparator; |
146 | 155 |
147 // Whether or not the current request wants credit info back. | 156 // Whether or not the current request wants credit info back. |
148 bool RequestingCreditCardInfo() const; | 157 bool RequestingCreditCardInfo() const; |
149 | 158 |
150 // Whether the information input in this dialog will be securely transmitted | 159 // Whether the information input in this dialog will be securely transmitted |
151 // to the requesting site. | 160 // to the requesting site. |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 | 269 |
261 // The section for which |popup_controller_| is currently showing a popup | 270 // The section for which |popup_controller_| is currently showing a popup |
262 // (if any). | 271 // (if any). |
263 DialogSection section_showing_popup_; | 272 DialogSection section_showing_popup_; |
264 | 273 |
265 scoped_ptr<AutofillDialogView> view_; | 274 scoped_ptr<AutofillDialogView> view_; |
266 | 275 |
267 // A NotificationRegistrar for tracking the completion of sign-in. | 276 // A NotificationRegistrar for tracking the completion of sign-in. |
268 content::NotificationRegistrar registrar_; | 277 content::NotificationRegistrar registrar_; |
269 | 278 |
| 279 // For logging UMA metrics. |
| 280 const base::Time dialog_shown_timestamp_; |
| 281 const AutofillMetrics& metric_logger_; |
| 282 DialogRequester requester_; |
| 283 |
270 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); | 284 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerImpl); |
271 }; | 285 }; |
272 | 286 |
273 } // namespace autofill | 287 } // namespace autofill |
274 | 288 |
275 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ | 289 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_CONTROLLER_IMPL_H_ |
OLD | NEW |