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_AUTOFILL_AUTOFILL_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ |
6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ | 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 content::WebContents* GetWebContents() const; | 116 content::WebContents* GetWebContents() const; |
117 | 117 |
118 // Returns the present form structures seen by Autofill manager. | 118 // Returns the present form structures seen by Autofill manager. |
119 const std::vector<FormStructure*>& GetFormStructures(); | 119 const std::vector<FormStructure*>& GetFormStructures(); |
120 | 120 |
121 // Causes the dialog for request autocomplete feature to be shown. | 121 // Causes the dialog for request autocomplete feature to be shown. |
122 virtual void ShowRequestAutocompleteDialog( | 122 virtual void ShowRequestAutocompleteDialog( |
123 const FormData& form, | 123 const FormData& form, |
124 const GURL& source_url, | 124 const GURL& source_url, |
125 const content::SSLStatus& ssl_status, | 125 const content::SSLStatus& ssl_status, |
| 126 autofill::DialogType dialog_type, |
126 const base::Callback<void(const FormStructure*)>& callback); | 127 const base::Callback<void(const FormStructure*)>& callback); |
127 | 128 |
128 // Happens when the autocomplete dialog runs its callback when being closed. | 129 // Happens when the autocomplete dialog runs its callback when being closed. |
129 void RequestAutocompleteDialogClosed(); | 130 void RequestAutocompleteDialogClosed(); |
130 | 131 |
131 autofill::AutofillManagerDelegate* delegate() const { | 132 autofill::AutofillManagerDelegate* delegate() const { |
132 return manager_delegate_; | 133 return manager_delegate_; |
133 } | 134 } |
134 | 135 |
135 protected: | 136 protected: |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 void set_metric_logger(const AutofillMetrics* metric_logger); | 186 void set_metric_logger(const AutofillMetrics* metric_logger); |
186 | 187 |
187 ScopedVector<FormStructure>* form_structures() { return &form_structures_; } | 188 ScopedVector<FormStructure>* form_structures() { return &form_structures_; } |
188 | 189 |
189 // Exposed for testing. | 190 // Exposed for testing. |
190 AutofillExternalDelegate* external_delegate() { | 191 AutofillExternalDelegate* external_delegate() { |
191 return external_delegate_; | 192 return external_delegate_; |
192 } | 193 } |
193 | 194 |
194 // Exposed for testing. | 195 // Exposed for testing. |
195 AutocheckoutManager* autocheckout_manager() { | 196 autofill::AutocheckoutManager* autocheckout_manager() { |
196 return &autocheckout_manager_; | 197 return &autocheckout_manager_; |
197 } | 198 } |
198 | 199 |
199 // Processes the submitted |form|, saving any new Autofill data and uploading | 200 // Processes the submitted |form|, saving any new Autofill data and uploading |
200 // the possible field types for the submitted fields to the crowdsouring | 201 // the possible field types for the submitted fields to the crowdsouring |
201 // server. Returns false if this form is not relevant for Autofill. | 202 // server. Returns false if this form is not relevant for Autofill. |
202 bool OnFormSubmitted(const FormData& form, | 203 bool OnFormSubmitted(const FormData& form, |
203 const base::TimeTicks& timestamp); | 204 const base::TimeTicks& timestamp); |
204 | 205 |
205 // Tell the renderer the current interactive autocomplete finished. | 206 // Tell the renderer the current interactive autocomplete finished. |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 // Should be set to true in AutofillManagerTest and other tests, false in | 364 // Should be set to true in AutofillManagerTest and other tests, false in |
364 // AutofillDownloadManagerTest and in non-test environment. Is false by | 365 // AutofillDownloadManagerTest and in non-test environment. Is false by |
365 // default for the public constructor, and true by default for the test-only | 366 // default for the public constructor, and true by default for the test-only |
366 // constructors. | 367 // constructors. |
367 bool disable_download_manager_requests_; | 368 bool disable_download_manager_requests_; |
368 | 369 |
369 // Handles single-field autocomplete form data. | 370 // Handles single-field autocomplete form data. |
370 AutocompleteHistoryManager autocomplete_history_manager_; | 371 AutocompleteHistoryManager autocomplete_history_manager_; |
371 | 372 |
372 // Handles autocheckout flows. | 373 // Handles autocheckout flows. |
373 AutocheckoutManager autocheckout_manager_; | 374 autofill::AutocheckoutManager autocheckout_manager_; |
374 | 375 |
375 // For logging UMA metrics. Overridden by metrics tests. | 376 // For logging UMA metrics. Overridden by metrics tests. |
376 scoped_ptr<const AutofillMetrics> metric_logger_; | 377 scoped_ptr<const AutofillMetrics> metric_logger_; |
377 // Have we logged whether Autofill is enabled for this page load? | 378 // Have we logged whether Autofill is enabled for this page load? |
378 bool has_logged_autofill_enabled_; | 379 bool has_logged_autofill_enabled_; |
379 // Have we logged an address suggestions count metric for this page? | 380 // Have we logged an address suggestions count metric for this page? |
380 bool has_logged_address_suggestions_count_; | 381 bool has_logged_address_suggestions_count_; |
381 // Have we shown Autofill suggestions at least once? | 382 // Have we shown Autofill suggestions at least once? |
382 bool did_show_suggestions_; | 383 bool did_show_suggestions_; |
383 // Has the user manually edited at least one form field among the autofillable | 384 // Has the user manually edited at least one form field among the autofillable |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, | 436 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, |
436 TestTabContentsWithExternalDelegate); | 437 TestTabContentsWithExternalDelegate); |
437 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, | 438 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, |
438 UserHappinessFormLoadAndSubmission); | 439 UserHappinessFormLoadAndSubmission); |
439 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, UserHappinessFormInteraction); | 440 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, UserHappinessFormInteraction); |
440 | 441 |
441 DISALLOW_COPY_AND_ASSIGN(AutofillManager); | 442 DISALLOW_COPY_AND_ASSIGN(AutofillManager); |
442 }; | 443 }; |
443 | 444 |
444 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ | 445 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ |
OLD | NEW |