| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 #include "ui/base/l10n/l10n_util.h" | 51 #include "ui/base/l10n/l10n_util.h" |
| 52 #include "ui/gfx/rect.h" | 52 #include "ui/gfx/rect.h" |
| 53 #include "url/gurl.h" | 53 #include "url/gurl.h" |
| 54 | 54 |
| 55 namespace autofill { | 55 namespace autofill { |
| 56 | 56 |
| 57 typedef PersonalDataManager::GUIDPair GUIDPair; | 57 typedef PersonalDataManager::GUIDPair GUIDPair; |
| 58 | 58 |
| 59 using base::TimeTicks; | 59 using base::TimeTicks; |
| 60 using content::RenderViewHost; | 60 using content::RenderViewHost; |
| 61 using WebKit::WebFormElement; | 61 using blink::WebFormElement; |
| 62 | 62 |
| 63 namespace { | 63 namespace { |
| 64 | 64 |
| 65 // We only send a fraction of the forms to upload server. | 65 // We only send a fraction of the forms to upload server. |
| 66 // The rate for positive/negative matches potentially could be different. | 66 // The rate for positive/negative matches potentially could be different. |
| 67 const double kAutofillPositiveUploadRateDefaultValue = 0.20; | 67 const double kAutofillPositiveUploadRateDefaultValue = 0.20; |
| 68 const double kAutofillNegativeUploadRateDefaultValue = 0.20; | 68 const double kAutofillNegativeUploadRateDefaultValue = 0.20; |
| 69 | 69 |
| 70 const size_t kMaxRecentFormSignaturesToRemember = 3; | 70 const size_t kMaxRecentFormSignaturesToRemember = 3; |
| 71 | 71 |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 int warning = 0; | 411 int warning = 0; |
| 412 if (!form_structure->IsAutofillable(true)) | 412 if (!form_structure->IsAutofillable(true)) |
| 413 warning = IDS_AUTOFILL_WARNING_FORM_DISABLED; | 413 warning = IDS_AUTOFILL_WARNING_FORM_DISABLED; |
| 414 else if (is_filling_credit_card && !FormIsHTTPS(*form_structure)) | 414 else if (is_filling_credit_card && !FormIsHTTPS(*form_structure)) |
| 415 warning = IDS_AUTOFILL_WARNING_INSECURE_CONNECTION; | 415 warning = IDS_AUTOFILL_WARNING_INSECURE_CONNECTION; |
| 416 if (warning) { | 416 if (warning) { |
| 417 values.assign(1, l10n_util::GetStringUTF16(warning)); | 417 values.assign(1, l10n_util::GetStringUTF16(warning)); |
| 418 labels.assign(1, base::string16()); | 418 labels.assign(1, base::string16()); |
| 419 icons.assign(1, base::string16()); | 419 icons.assign(1, base::string16()); |
| 420 unique_ids.assign(1, | 420 unique_ids.assign(1, |
| 421 WebKit::WebAutofillClient::MenuItemIDWarningMessage); | 421 blink::WebAutofillClient::MenuItemIDWarningMessage); |
| 422 } else { | 422 } else { |
| 423 bool section_is_autofilled = | 423 bool section_is_autofilled = |
| 424 SectionIsAutofilled(*form_structure, form, | 424 SectionIsAutofilled(*form_structure, form, |
| 425 autofill_field->section()); | 425 autofill_field->section()); |
| 426 if (section_is_autofilled) { | 426 if (section_is_autofilled) { |
| 427 // If the relevant section is auto-filled and the renderer is querying | 427 // If the relevant section is auto-filled and the renderer is querying |
| 428 // for suggestions, then the user is editing the value of a field. | 428 // for suggestions, then the user is editing the value of a field. |
| 429 // In this case, mimic autocomplete: don't display labels or icons, | 429 // In this case, mimic autocomplete: don't display labels or icons, |
| 430 // as that information is redundant. | 430 // as that information is redundant. |
| 431 labels.assign(labels.size(), base::string16()); | 431 labels.assign(labels.size(), base::string16()); |
| (...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1174 return false; | 1174 return false; |
| 1175 | 1175 |
| 1176 // 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. |
| 1177 if (!form.ShouldBeParsed(true)) | 1177 if (!form.ShouldBeParsed(true)) |
| 1178 return false; | 1178 return false; |
| 1179 | 1179 |
| 1180 return true; | 1180 return true; |
| 1181 } | 1181 } |
| 1182 | 1182 |
| 1183 } // namespace autofill | 1183 } // namespace autofill |
| OLD | NEW |