| OLD | NEW |
| 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/sync/glue/autofill_profile_change_processor.h" | 5 #include "chrome/browser/sync/glue/autofill_profile_change_processor.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 if (!node.InitUniqueByCreation(syncable::AUTOFILL_PROFILE, | 279 if (!node.InitUniqueByCreation(syncable::AUTOFILL_PROFILE, |
| 280 autofill_profile_root, | 280 autofill_profile_root, |
| 281 profile.guid())) { | 281 profile.guid())) { |
| 282 LOG(ERROR) << "could not create a sync node "; | 282 LOG(ERROR) << "could not create a sync node "; |
| 283 return; | 283 return; |
| 284 } | 284 } |
| 285 | 285 |
| 286 node.SetTitle(UTF8ToWide(profile.guid())); | 286 node.SetTitle(UTF8ToWide(profile.guid())); |
| 287 | 287 |
| 288 WriteAutofillProfile(profile, &node); | 288 WriteAutofillProfile(profile, &node); |
| 289 |
| 290 std::string guid = profile.guid(); |
| 291 model_associator_->Associate(&guid, node.GetId()); |
| 289 } | 292 } |
| 290 | 293 |
| 291 void AutofillProfileChangeProcessor::StartObserving() { | 294 void AutofillProfileChangeProcessor::StartObserving() { |
| 292 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); | 295 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); |
| 293 notification_registrar_.Add(this, | 296 notification_registrar_.Add(this, |
| 294 NotificationType::AUTOFILL_PROFILE_CHANGED_GUID, | 297 NotificationType::AUTOFILL_PROFILE_CHANGED_GUID, |
| 295 NotificationService::AllSources()); | 298 NotificationService::AllSources()); |
| 296 } | 299 } |
| 297 | 300 |
| 298 void AutofillProfileChangeProcessor::StopObserving() { | 301 void AutofillProfileChangeProcessor::StopObserving() { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 329 AutoFillType(COMPANY_NAME)))); | 332 AutoFillType(COMPANY_NAME)))); |
| 330 specifics.set_phone_fax_whole_number(UTF16ToUTF8(profile.GetFieldText( | 333 specifics.set_phone_fax_whole_number(UTF16ToUTF8(profile.GetFieldText( |
| 331 AutoFillType(PHONE_FAX_WHOLE_NUMBER)))); | 334 AutoFillType(PHONE_FAX_WHOLE_NUMBER)))); |
| 332 specifics.set_phone_home_whole_number(UTF16ToUTF8(profile.GetFieldText( | 335 specifics.set_phone_home_whole_number(UTF16ToUTF8(profile.GetFieldText( |
| 333 AutoFillType(PHONE_HOME_WHOLE_NUMBER)))); | 336 AutoFillType(PHONE_HOME_WHOLE_NUMBER)))); |
| 334 node->SetAutofillProfileSpecifics(specifics); | 337 node->SetAutofillProfileSpecifics(specifics); |
| 335 } | 338 } |
| 336 | 339 |
| 337 } // namespace browser_sync | 340 } // namespace browser_sync |
| 338 | 341 |
| OLD | NEW |