| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/autofill/autofill_manager.h" | 5 #include "chrome/browser/autofill/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 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1077 } | 1077 } |
| 1078 | 1078 |
| 1079 void AutofillManager::FillFormField(const AutofillProfile& profile, | 1079 void AutofillManager::FillFormField(const AutofillProfile& profile, |
| 1080 const AutofillField& cached_field, | 1080 const AutofillField& cached_field, |
| 1081 size_t variant, | 1081 size_t variant, |
| 1082 webkit_glue::FormField* field) { | 1082 webkit_glue::FormField* field) { |
| 1083 AutofillFieldType type = cached_field.type(); | 1083 AutofillFieldType type = cached_field.type(); |
| 1084 DCHECK_NE(AutofillType::CREDIT_CARD, AutofillType(type).group()); | 1084 DCHECK_NE(AutofillType::CREDIT_CARD, AutofillType(type).group()); |
| 1085 DCHECK(field); | 1085 DCHECK(field); |
| 1086 | 1086 |
| 1087 if (AutofillType(type).subgroup() == AutofillType::PHONE_NUMBER) { | 1087 if (type == PHONE_HOME_NUMBER) { |
| 1088 FillPhoneNumberField(profile, cached_field, variant, field); | 1088 FillPhoneNumberField(profile, cached_field, variant, field); |
| 1089 } else { | 1089 } else { |
| 1090 if (field->form_control_type == ASCIIToUTF16("select-one")) { | 1090 if (field->form_control_type == ASCIIToUTF16("select-one")) { |
| 1091 autofill::FillSelectControl(profile, type, field); | 1091 autofill::FillSelectControl(profile, type, field); |
| 1092 } else { | 1092 } else { |
| 1093 std::vector<string16> values; | 1093 std::vector<string16> values; |
| 1094 profile.GetCanonicalizedMultiInfo(type, &values); | 1094 profile.GetCanonicalizedMultiInfo(type, &values); |
| 1095 DCHECK(variant < values.size()); | 1095 DCHECK(variant < values.size()); |
| 1096 field->value = values[variant]; | 1096 field->value = values[variant]; |
| 1097 } | 1097 } |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1219 *profile_guid = IDToGUID(profile_id); | 1219 *profile_guid = IDToGUID(profile_id); |
| 1220 } | 1220 } |
| 1221 | 1221 |
| 1222 void AutofillManager::UpdateInitialInteractionTimestamp( | 1222 void AutofillManager::UpdateInitialInteractionTimestamp( |
| 1223 const TimeTicks& interaction_timestamp) { | 1223 const TimeTicks& interaction_timestamp) { |
| 1224 if (initial_interaction_timestamp_.is_null() || | 1224 if (initial_interaction_timestamp_.is_null() || |
| 1225 interaction_timestamp < initial_interaction_timestamp_) { | 1225 interaction_timestamp < initial_interaction_timestamp_) { |
| 1226 initial_interaction_timestamp_ = interaction_timestamp; | 1226 initial_interaction_timestamp_ = interaction_timestamp; |
| 1227 } | 1227 } |
| 1228 } | 1228 } |
| OLD | NEW |