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> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
15 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
18 #include "base/memory/scoped_vector.h" | 18 #include "base/memory/scoped_vector.h" |
19 #include "base/memory/weak_ptr.h" | 19 #include "base/memory/weak_ptr.h" |
20 #include "base/prefs/public/pref_change_registrar.h" | 20 #include "base/prefs/public/pref_change_registrar.h" |
21 #include "base/string16.h" | 21 #include "base/string16.h" |
22 #include "base/time.h" | 22 #include "base/time.h" |
23 #include "chrome/browser/api/sync/profile_sync_service_observer.h" | 23 #include "chrome/browser/api/sync/profile_sync_service_observer.h" |
24 #include "chrome/browser/autofill/autocheckout_manager.h" | |
24 #include "chrome/browser/autofill/autocomplete_history_manager.h" | 25 #include "chrome/browser/autofill/autocomplete_history_manager.h" |
25 #include "chrome/browser/autofill/autofill_download.h" | 26 #include "chrome/browser/autofill/autofill_download.h" |
26 #include "chrome/browser/autofill/field_types.h" | 27 #include "chrome/browser/autofill/field_types.h" |
27 #include "chrome/browser/autofill/form_structure.h" | 28 #include "chrome/browser/autofill/form_structure.h" |
28 #include "chrome/browser/autofill/personal_data_manager.h" | 29 #include "chrome/browser/autofill/personal_data_manager.h" |
29 #include "chrome/common/autofill/autocheckout_status.h" | 30 #include "chrome/common/autofill/autocheckout_status.h" |
31 #include "chrome/common/form_data.h" | |
30 #include "content/public/browser/web_contents_observer.h" | 32 #include "content/public/browser/web_contents_observer.h" |
31 #include "content/public/common/ssl_status.h" | 33 #include "content/public/common/ssl_status.h" |
32 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormElement.h" | 34 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormElement.h" |
33 | 35 |
36 class AutocheckoutManager; | |
Ilya Sherman
2013/01/17 01:21:44
nit: Omit this; it's redundant with the #include a
Raman Kakilate
2013/01/17 06:40:33
Done.
| |
34 class AutofillExternalDelegate; | 37 class AutofillExternalDelegate; |
35 class AutofillField; | 38 class AutofillField; |
36 class AutofillProfile; | 39 class AutofillProfile; |
37 class AutofillMetrics; | 40 class AutofillMetrics; |
38 class CreditCard; | 41 class CreditCard; |
39 class FormGroup; | 42 class FormGroup; |
40 class GURL; | 43 class GURL; |
41 class PrefServiceSyncable; | 44 class PrefServiceSyncable; |
42 class ProfileSyncService; | 45 class ProfileSyncService; |
43 | 46 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
100 int max_length, | 103 int max_length, |
101 const content::PasswordForm& form); | 104 const content::PasswordForm& form); |
102 | 105 |
103 // Remove the credit card or Autofill profile that matches |unique_id| | 106 // Remove the credit card or Autofill profile that matches |unique_id| |
104 // from the database. | 107 // from the database. |
105 void RemoveAutofillProfileOrCreditCard(int unique_id); | 108 void RemoveAutofillProfileOrCreditCard(int unique_id); |
106 | 109 |
107 // Remove the specified Autocomplete entry. | 110 // Remove the specified Autocomplete entry. |
108 void RemoveAutocompleteEntry(const string16& name, const string16& value); | 111 void RemoveAutocompleteEntry(const string16& name, const string16& value); |
109 | 112 |
113 // Show dialog for autocheckout. |frame_url| and |ssl_status| are used to | |
114 // hint the user about security. | |
115 virtual void ShowAutocheckoutDialog( | |
116 const GURL& frame_url, | |
117 const content::SSLStatus& ssl_status); | |
Ilya Sherman
2013/01/17 01:21:44
This should be part of the AutocheckoutManager cla
Raman Kakilate
2013/01/17 06:40:33
this method is required to proxy web_contents() to
| |
118 | |
110 protected: | 119 protected: |
111 // Only test code should subclass AutofillManager. | 120 // Only test code should subclass AutofillManager. |
112 friend class base::RefCounted<AutofillManager>; | 121 friend class base::RefCounted<AutofillManager>; |
113 | 122 |
114 AutofillManager(content::WebContents* web_contents, | 123 AutofillManager(content::WebContents* web_contents, |
115 autofill::AutofillManagerDelegate* delegate); | 124 autofill::AutofillManagerDelegate* delegate); |
116 virtual ~AutofillManager(); | 125 virtual ~AutofillManager(); |
117 | 126 |
118 // Test code should prefer to use this constructor. | 127 // Test code should prefer to use this constructor. |
119 AutofillManager(content::WebContents* web_contents, | 128 AutofillManager(content::WebContents* web_contents, |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
329 | 338 |
330 // Should be set to true in AutofillManagerTest and other tests, false in | 339 // Should be set to true in AutofillManagerTest and other tests, false in |
331 // AutofillDownloadManagerTest and in non-test environment. Is false by | 340 // AutofillDownloadManagerTest and in non-test environment. Is false by |
332 // default for the public constructor, and true by default for the test-only | 341 // default for the public constructor, and true by default for the test-only |
333 // constructors. | 342 // constructors. |
334 bool disable_download_manager_requests_; | 343 bool disable_download_manager_requests_; |
335 | 344 |
336 // Handles single-field autocomplete form data. | 345 // Handles single-field autocomplete form data. |
337 AutocompleteHistoryManager autocomplete_history_manager_; | 346 AutocompleteHistoryManager autocomplete_history_manager_; |
338 | 347 |
348 // Handles autocheckout flows. | |
349 scoped_refptr<AutocheckoutManager> autocheckout_manager_; | |
Ilya Sherman
2013/01/17 01:21:44
Why is this class reference counted? You should j
Raman Kakilate
2013/01/17 06:40:33
AutcheckoutManager::ReturnAutocheckoutData has to
| |
350 | |
339 // For logging UMA metrics. Overridden by metrics tests. | 351 // For logging UMA metrics. Overridden by metrics tests. |
340 scoped_ptr<const AutofillMetrics> metric_logger_; | 352 scoped_ptr<const AutofillMetrics> metric_logger_; |
341 // Have we logged whether Autofill is enabled for this page load? | 353 // Have we logged whether Autofill is enabled for this page load? |
342 bool has_logged_autofill_enabled_; | 354 bool has_logged_autofill_enabled_; |
343 // Have we logged an address suggestions count metric for this page? | 355 // Have we logged an address suggestions count metric for this page? |
344 bool has_logged_address_suggestions_count_; | 356 bool has_logged_address_suggestions_count_; |
345 // Have we shown Autofill suggestions at least once? | 357 // Have we shown Autofill suggestions at least once? |
346 bool did_show_suggestions_; | 358 bool did_show_suggestions_; |
347 // Has the user manually edited at least one form field among the autofillable | 359 // Has the user manually edited at least one form field among the autofillable |
348 // ones? | 360 // ones? |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
399 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, | 411 FRIEND_TEST_ALL_PREFIXES(AutofillManagerTest, |
400 TestTabContentsWithExternalDelegate); | 412 TestTabContentsWithExternalDelegate); |
401 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, | 413 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, |
402 UserHappinessFormLoadAndSubmission); | 414 UserHappinessFormLoadAndSubmission); |
403 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, UserHappinessFormInteraction); | 415 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, UserHappinessFormInteraction); |
404 | 416 |
405 DISALLOW_COPY_AND_ASSIGN(AutofillManager); | 417 DISALLOW_COPY_AND_ASSIGN(AutofillManager); |
406 }; | 418 }; |
407 | 419 |
408 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ | 420 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_MANAGER_H_ |
OLD | NEW |