OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "components/autofill/core/browser/autofill_manager.h" | 5 #include "components/autofill/core/browser/autofill_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 #include <map> | 10 #include <map> |
(...skipping 29 matching lines...) Expand all Loading... |
40 #include "components/autofill/core/common/autofill_switches.h" | 40 #include "components/autofill/core/common/autofill_switches.h" |
41 #include "components/autofill/core/common/form_data.h" | 41 #include "components/autofill/core/common/form_data.h" |
42 #include "components/autofill/core/common/form_data_predictions.h" | 42 #include "components/autofill/core/common/form_data_predictions.h" |
43 #include "components/autofill/core/common/form_field_data.h" | 43 #include "components/autofill/core/common/form_field_data.h" |
44 #include "components/autofill/core/common/password_form_fill_data.h" | 44 #include "components/autofill/core/common/password_form_fill_data.h" |
45 #include "components/user_prefs/pref_registry_syncable.h" | 45 #include "components/user_prefs/pref_registry_syncable.h" |
46 #include "content/public/browser/browser_context.h" | 46 #include "content/public/browser/browser_context.h" |
47 #include "content/public/browser/browser_thread.h" | 47 #include "content/public/browser/browser_thread.h" |
48 #include "content/public/browser/render_view_host.h" | 48 #include "content/public/browser/render_view_host.h" |
49 #include "content/public/browser/web_contents.h" | 49 #include "content/public/browser/web_contents.h" |
50 #include "content/public/common/url_constants.h" | |
51 #include "grit/component_strings.h" | 50 #include "grit/component_strings.h" |
52 #include "third_party/WebKit/public/web/WebAutofillClient.h" | 51 #include "third_party/WebKit/public/web/WebAutofillClient.h" |
53 #include "ui/base/l10n/l10n_util.h" | 52 #include "ui/base/l10n/l10n_util.h" |
54 #include "ui/gfx/rect.h" | 53 #include "ui/gfx/rect.h" |
55 #include "url/gurl.h" | 54 #include "url/gurl.h" |
56 | 55 |
57 namespace autofill { | 56 namespace autofill { |
58 | 57 |
59 typedef PersonalDataManager::GUIDPair GUIDPair; | 58 typedef PersonalDataManager::GUIDPair GUIDPair; |
60 | 59 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 if (form_structure.field(i)->section() == section && | 118 if (form_structure.field(i)->section() == section && |
120 form.fields[i].is_autofilled) { | 119 form.fields[i].is_autofilled) { |
121 return true; | 120 return true; |
122 } | 121 } |
123 } | 122 } |
124 | 123 |
125 return false; | 124 return false; |
126 } | 125 } |
127 | 126 |
128 bool FormIsHTTPS(const FormStructure& form) { | 127 bool FormIsHTTPS(const FormStructure& form) { |
129 return form.source_url().SchemeIs(content::kHttpsScheme); | 128 // TODO(blundell): Change this to use a constant once crbug.com/306258 is |
| 129 // fixed. |
| 130 return form.source_url().SchemeIs("https"); |
130 } | 131 } |
131 | 132 |
132 // Uses the existing personal data in |profiles| and |credit_cards| to determine | 133 // Uses the existing personal data in |profiles| and |credit_cards| to determine |
133 // possible field types for the |submitted_form|. This is potentially | 134 // possible field types for the |submitted_form|. This is potentially |
134 // expensive -- on the order of 50ms even for a small set of |stored_data|. | 135 // expensive -- on the order of 50ms even for a small set of |stored_data|. |
135 // Hence, it should not run on the UI thread -- to avoid locking up the UI -- | 136 // Hence, it should not run on the UI thread -- to avoid locking up the UI -- |
136 // nor on the IO thread -- to avoid blocking IPC calls. | 137 // nor on the IO thread -- to avoid blocking IPC calls. |
137 void DeterminePossibleFieldTypesForUpload( | 138 void DeterminePossibleFieldTypesForUpload( |
138 const std::vector<AutofillProfile>& profiles, | 139 const std::vector<AutofillProfile>& profiles, |
139 const std::vector<CreditCard>& credit_cards, | 140 const std::vector<CreditCard>& credit_cards, |
(...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1173 return false; | 1174 return false; |
1174 | 1175 |
1175 // Disregard forms that we wouldn't ever autofill in the first place. | 1176 // Disregard forms that we wouldn't ever autofill in the first place. |
1176 if (!form.ShouldBeParsed(true)) | 1177 if (!form.ShouldBeParsed(true)) |
1177 return false; | 1178 return false; |
1178 | 1179 |
1179 return true; | 1180 return true; |
1180 } | 1181 } |
1181 | 1182 |
1182 } // namespace autofill | 1183 } // namespace autofill |
OLD | NEW |