| 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 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 964 profile->GetCanonicalizedMultiInfo(type, &multi_values); | 964 profile->GetCanonicalizedMultiInfo(type, &multi_values); |
| 965 | 965 |
| 966 for (size_t i = 0; i < multi_values.size(); ++i) { | 966 for (size_t i = 0; i < multi_values.size(); ++i) { |
| 967 if (multi_values[i].empty()) | 967 if (multi_values[i].empty()) |
| 968 continue; | 968 continue; |
| 969 string16 profile_value_lower_case(StringToLowerASCII(multi_values[i])); | 969 string16 profile_value_lower_case(StringToLowerASCII(multi_values[i])); |
| 970 string16 field_value_lower_case(StringToLowerASCII(field.value)); | 970 string16 field_value_lower_case(StringToLowerASCII(field.value)); |
| 971 // Phone numbers could be split in US forms, so field value could be | 971 // Phone numbers could be split in US forms, so field value could be |
| 972 // either prefix or suffix of the phone. | 972 // either prefix or suffix of the phone. |
| 973 bool matched_phones = false; | 973 bool matched_phones = false; |
| 974 if ((type == PHONE_HOME_NUMBER || type == PHONE_FAX_NUMBER) && | 974 if (type == PHONE_HOME_NUMBER && !field_value_lower_case.empty() && |
| 975 !field_value_lower_case.empty() && | |
| 976 (profile_value_lower_case.find(field_value_lower_case) != | 975 (profile_value_lower_case.find(field_value_lower_case) != |
| 977 string16::npos)) { | 976 string16::npos)) { |
| 978 matched_phones = true; | 977 matched_phones = true; |
| 979 } | 978 } |
| 980 if (matched_phones || | 979 if (matched_phones || |
| 981 profile_value_lower_case == field_value_lower_case) { | 980 profile_value_lower_case == field_value_lower_case) { |
| 982 for (size_t j = 0; j < multi_values.size(); ++j) { | 981 for (size_t j = 0; j < multi_values.size(); ++j) { |
| 983 if (!multi_values[j].empty()) { | 982 if (!multi_values[j].empty()) { |
| 984 values->push_back(multi_values[j]); | 983 values->push_back(multi_values[j]); |
| 985 unique_ids->push_back(PackGUIDs(GUIDPair(std::string(), 0), | 984 unique_ids->push_back(PackGUIDs(GUIDPair(std::string(), 0), |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1205 *profile_guid = IDToGUID(profile_id); | 1204 *profile_guid = IDToGUID(profile_id); |
| 1206 } | 1205 } |
| 1207 | 1206 |
| 1208 void AutofillManager::UpdateInitialInteractionTimestamp( | 1207 void AutofillManager::UpdateInitialInteractionTimestamp( |
| 1209 const TimeTicks& interaction_timestamp) { | 1208 const TimeTicks& interaction_timestamp) { |
| 1210 if (initial_interaction_timestamp_.is_null() || | 1209 if (initial_interaction_timestamp_.is_null() || |
| 1211 interaction_timestamp < initial_interaction_timestamp_) { | 1210 interaction_timestamp < initial_interaction_timestamp_) { |
| 1212 initial_interaction_timestamp_ = interaction_timestamp; | 1211 initial_interaction_timestamp_ = interaction_timestamp; |
| 1213 } | 1212 } |
| 1214 } | 1213 } |
| OLD | NEW |