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

Unified Diff: chrome/browser/autofill/autofill_profile.cc

Issue 5608004: AutoFillProfile: don't replicate logic in Clone() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/autofill/autofill_profile_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/autofill_profile.cc
diff --git a/chrome/browser/autofill/autofill_profile.cc b/chrome/browser/autofill/autofill_profile.cc
index 40a749b2e8347fd18f9a6f5b25459a4b28864492..913497d5298040190a1644d48059654d7a0dcc91 100644
--- a/chrome/browser/autofill/autofill_profile.cc
+++ b/chrome/browser/autofill/autofill_profile.cc
@@ -147,18 +147,7 @@ void AutoFillProfile::SetInfo(const AutoFillType& type, const string16& value) {
}
FormGroup* AutoFillProfile::Clone() const {
- AutoFillProfile* profile = new AutoFillProfile();
- profile->label_ = label_;
- profile->guid_ = guid();
-
- FormGroupMap::const_iterator iter;
- for (iter = personal_info_.begin(); iter != personal_info_.end(); ++iter) {
- if (profile->personal_info_.count(iter->first))
- delete profile->personal_info_[iter->first];
- profile->personal_info_[iter->first] = iter->second->Clone();
- }
-
- return profile;
+ return new AutoFillProfile(*this);
}
const string16 AutoFillProfile::Label() const {
« no previous file with comments | « no previous file | chrome/browser/autofill/autofill_profile_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698