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

Side by Side Diff: chrome/browser/autofill/autofill_profile.cc

Issue 5364007: Autofill should not allow overwrite of field data when merging profile data (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Whitespace. Created 10 years 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
« no previous file with comments | « no previous file | chrome/browser/autofill/personal_data_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_profile.h" 5 #include "chrome/browser/autofill/autofill_profile.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 427
428 return Compare(profile) == 0; 428 return Compare(profile) == 0;
429 } 429 }
430 430
431 bool AutoFillProfile::operator!=(const AutoFillProfile& profile) const { 431 bool AutoFillProfile::operator!=(const AutoFillProfile& profile) const {
432 return !operator==(profile); 432 return !operator==(profile);
433 } 433 }
434 434
435 const string16 AutoFillProfile::PrimaryValue() const { 435 const string16 AutoFillProfile::PrimaryValue() const {
436 return GetFieldText(AutoFillType(NAME_FULL)) + 436 return GetFieldText(AutoFillType(NAME_FULL)) +
437 GetFieldText(AutoFillType(ADDRESS_HOME_LINE1)); 437 GetFieldText(AutoFillType(ADDRESS_HOME_LINE1)) +
438 GetFieldText(AutoFillType(ADDRESS_HOME_LINE2)) +
439 GetFieldText(AutoFillType(EMAIL_ADDRESS));
438 } 440 }
439 441
440 Address* AutoFillProfile::GetHomeAddress() { 442 Address* AutoFillProfile::GetHomeAddress() {
441 return static_cast<Address*>(personal_info_[AutoFillType::ADDRESS_HOME]); 443 return static_cast<Address*>(personal_info_[AutoFillType::ADDRESS_HOME]);
442 } 444 }
443 445
444 string16 AutoFillProfile::ConstructInferredLabel( 446 string16 AutoFillProfile::ConstructInferredLabel(
445 const std::vector<AutoFillFieldType>* included_fields) const { 447 const std::vector<AutoFillFieldType>* included_fields) const {
446 DCHECK(included_fields); 448 DCHECK(included_fields);
447 string16 label; 449 string16 label;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 << UTF16ToUTF8(profile.GetFieldText(AutoFillType(ADDRESS_HOME_ZIP))) 495 << UTF16ToUTF8(profile.GetFieldText(AutoFillType(ADDRESS_HOME_ZIP)))
494 << " " 496 << " "
495 << UTF16ToUTF8(profile.GetFieldText(AutoFillType(ADDRESS_HOME_COUNTRY))) 497 << UTF16ToUTF8(profile.GetFieldText(AutoFillType(ADDRESS_HOME_COUNTRY)))
496 << " " 498 << " "
497 << UTF16ToUTF8(profile.GetFieldText(AutoFillType( 499 << UTF16ToUTF8(profile.GetFieldText(AutoFillType(
498 PHONE_HOME_WHOLE_NUMBER))) 500 PHONE_HOME_WHOLE_NUMBER)))
499 << " " 501 << " "
500 << UTF16ToUTF8(profile.GetFieldText(AutoFillType( 502 << UTF16ToUTF8(profile.GetFieldText(AutoFillType(
501 PHONE_FAX_WHOLE_NUMBER))); 503 PHONE_FAX_WHOLE_NUMBER)));
502 } 504 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/autofill/personal_data_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698