Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Side by Side Diff: components/autofill/core/browser/personal_data_manager.cc

Issue 212873003: Store the language code for the address in autofill profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixups Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698