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/personal_data_manager.h" | 5 #include "components/autofill/core/browser/personal_data_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <iterator> | 9 #include <iterator> |
10 | 10 |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 | 393 |
394 void PersonalDataManager::UpdateProfile(const AutofillProfile& profile) { | 394 void PersonalDataManager::UpdateProfile(const AutofillProfile& profile) { |
395 if (is_off_the_record_) | 395 if (is_off_the_record_) |
396 return; | 396 return; |
397 | 397 |
398 AutofillProfile* existing_profile = GetProfileByGUID(profile.guid()); | 398 AutofillProfile* existing_profile = GetProfileByGUID(profile.guid()); |
399 if (!existing_profile) | 399 if (!existing_profile) |
400 return; | 400 return; |
401 | 401 |
402 // Don't overwrite the origin for a profile that is already stored. | 402 // Don't overwrite the origin for a profile that is already stored. |
403 if (existing_profile->Compare(profile) == 0) | 403 if (existing_profile->EqualsSansOrigin(profile)) |
404 return; | 404 return; |
405 | 405 |
406 if (profile.IsEmpty(app_locale_)) { | 406 if (profile.IsEmpty(app_locale_)) { |
407 RemoveByGUID(profile.guid()); | 407 RemoveByGUID(profile.guid()); |
408 return; | 408 return; |
409 } | 409 } |
410 | 410 |
411 if (!database_.get()) | 411 if (!database_.get()) |
412 return; | 412 return; |
413 | 413 |
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1072 | 1072 |
1073 return std::string(); | 1073 return std::string(); |
1074 } | 1074 } |
1075 | 1075 |
1076 void PersonalDataManager::EnabledPrefChanged() { | 1076 void PersonalDataManager::EnabledPrefChanged() { |
1077 default_country_code_.clear(); | 1077 default_country_code_.clear(); |
1078 NotifyPersonalDataChanged(); | 1078 NotifyPersonalDataChanged(); |
1079 } | 1079 } |
1080 | 1080 |
1081 } // namespace autofill | 1081 } // namespace autofill |
OLD | NEW |