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 17 matching lines...) Expand all Loading... |
28 #include "components/autofill/core/browser/autofill_manager_delegate.h" | 28 #include "components/autofill/core/browser/autofill_manager_delegate.h" |
29 #include "components/autofill/core/browser/autofill_manager_test_delegate.h" | 29 #include "components/autofill/core/browser/autofill_manager_test_delegate.h" |
30 #include "components/autofill/core/browser/autofill_metrics.h" | 30 #include "components/autofill/core/browser/autofill_metrics.h" |
31 #include "components/autofill/core/browser/autofill_profile.h" | 31 #include "components/autofill/core/browser/autofill_profile.h" |
32 #include "components/autofill/core/browser/autofill_type.h" | 32 #include "components/autofill/core/browser/autofill_type.h" |
33 #include "components/autofill/core/browser/credit_card.h" | 33 #include "components/autofill/core/browser/credit_card.h" |
34 #include "components/autofill/core/browser/form_structure.h" | 34 #include "components/autofill/core/browser/form_structure.h" |
35 #include "components/autofill/core/browser/personal_data_manager.h" | 35 #include "components/autofill/core/browser/personal_data_manager.h" |
36 #include "components/autofill/core/browser/phone_number.h" | 36 #include "components/autofill/core/browser/phone_number.h" |
37 #include "components/autofill/core/browser/phone_number_i18n.h" | 37 #include "components/autofill/core/browser/phone_number_i18n.h" |
| 38 #include "components/autofill/core/browser/popup_item_ids.h" |
38 #include "components/autofill/core/common/autofill_data_validation.h" | 39 #include "components/autofill/core/common/autofill_data_validation.h" |
39 #include "components/autofill/core/common/autofill_pref_names.h" | 40 #include "components/autofill/core/common/autofill_pref_names.h" |
40 #include "components/autofill/core/common/autofill_switches.h" | 41 #include "components/autofill/core/common/autofill_switches.h" |
41 #include "components/autofill/core/common/form_data.h" | 42 #include "components/autofill/core/common/form_data.h" |
42 #include "components/autofill/core/common/form_data_predictions.h" | 43 #include "components/autofill/core/common/form_data_predictions.h" |
43 #include "components/autofill/core/common/form_field_data.h" | 44 #include "components/autofill/core/common/form_field_data.h" |
44 #include "components/autofill/core/common/password_form_fill_data.h" | 45 #include "components/autofill/core/common/password_form_fill_data.h" |
45 #include "components/user_prefs/pref_registry_syncable.h" | 46 #include "components/user_prefs/pref_registry_syncable.h" |
46 #include "grit/component_strings.h" | 47 #include "grit/component_strings.h" |
47 #include "third_party/WebKit/public/web/WebAutofillClient.h" | |
48 #include "ui/base/l10n/l10n_util.h" | 48 #include "ui/base/l10n/l10n_util.h" |
49 #include "ui/gfx/rect.h" | 49 #include "ui/gfx/rect.h" |
50 #include "url/gurl.h" | 50 #include "url/gurl.h" |
51 | 51 |
52 namespace autofill { | 52 namespace autofill { |
53 | 53 |
54 typedef PersonalDataManager::GUIDPair GUIDPair; | 54 typedef PersonalDataManager::GUIDPair GUIDPair; |
55 | 55 |
56 using base::TimeTicks; | 56 using base::TimeTicks; |
57 | 57 |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 // warning to the user in these cases. | 409 // warning to the user in these cases. |
410 int warning = 0; | 410 int warning = 0; |
411 if (!form_structure->IsAutofillable(true)) | 411 if (!form_structure->IsAutofillable(true)) |
412 warning = IDS_AUTOFILL_WARNING_FORM_DISABLED; | 412 warning = IDS_AUTOFILL_WARNING_FORM_DISABLED; |
413 else if (is_filling_credit_card && !FormIsHTTPS(*form_structure)) | 413 else if (is_filling_credit_card && !FormIsHTTPS(*form_structure)) |
414 warning = IDS_AUTOFILL_WARNING_INSECURE_CONNECTION; | 414 warning = IDS_AUTOFILL_WARNING_INSECURE_CONNECTION; |
415 if (warning) { | 415 if (warning) { |
416 values.assign(1, l10n_util::GetStringUTF16(warning)); | 416 values.assign(1, l10n_util::GetStringUTF16(warning)); |
417 labels.assign(1, base::string16()); | 417 labels.assign(1, base::string16()); |
418 icons.assign(1, base::string16()); | 418 icons.assign(1, base::string16()); |
419 unique_ids.assign(1, | 419 unique_ids.assign(1, POPUP_ITEM_ID_WARNING_MESSAGE); |
420 blink::WebAutofillClient::MenuItemIDWarningMessage); | |
421 } else { | 420 } else { |
422 bool section_is_autofilled = | 421 bool section_is_autofilled = |
423 SectionIsAutofilled(*form_structure, form, | 422 SectionIsAutofilled(*form_structure, form, |
424 autofill_field->section()); | 423 autofill_field->section()); |
425 if (section_is_autofilled) { | 424 if (section_is_autofilled) { |
426 // If the relevant section is auto-filled and the renderer is querying | 425 // If the relevant section is auto-filled and the renderer is querying |
427 // for suggestions, then the user is editing the value of a field. | 426 // for suggestions, then the user is editing the value of a field. |
428 // In this case, mimic autocomplete: don't display labels or icons, | 427 // In this case, mimic autocomplete: don't display labels or icons, |
429 // as that information is redundant. | 428 // as that information is redundant. |
430 labels.assign(labels.size(), base::string16()); | 429 labels.assign(labels.size(), base::string16()); |
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1127 return false; | 1126 return false; |
1128 | 1127 |
1129 // Disregard forms that we wouldn't ever autofill in the first place. | 1128 // Disregard forms that we wouldn't ever autofill in the first place. |
1130 if (!form.ShouldBeParsed(true)) | 1129 if (!form.ShouldBeParsed(true)) |
1131 return false; | 1130 return false; |
1132 | 1131 |
1133 return true; | 1132 return true; |
1134 } | 1133 } |
1135 | 1134 |
1136 } // namespace autofill | 1135 } // namespace autofill |
OLD | NEW |