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_change_processor.h" | 5 #include "chrome/browser/sync/glue/autofill_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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 std::vector<base::Time> timestamps; | 201 std::vector<base::Time> timestamps; |
202 if (!web_database_->GetAutofillTimestamps( | 202 if (!web_database_->GetAutofillTimestamps( |
203 change->key().name(), | 203 change->key().name(), |
204 change->key().value(), | 204 change->key().value(), |
205 ×tamps)) { | 205 ×tamps)) { |
206 error_handler()->OnUnrecoverableError(FROM_HERE, | 206 error_handler()->OnUnrecoverableError(FROM_HERE, |
207 "Failed to get timestamps."); | 207 "Failed to get timestamps."); |
208 return; | 208 return; |
209 } | 209 } |
210 | 210 |
211 sync_node.SetTitle(UTF16ToWide(change->key().name() + | 211 sync_node.SetTitle(UTF8ToWide(tag)); |
212 change->key().value())); | |
213 | 212 |
214 WriteAutofillEntry(AutofillEntry(change->key(), timestamps), | 213 WriteAutofillEntry(AutofillEntry(change->key(), timestamps), |
215 &sync_node); | 214 &sync_node); |
216 model_associator_->Associate(&tag, sync_node.GetId()); | 215 model_associator_->Associate(&tag, sync_node.GetId()); |
217 } | 216 } |
218 break; | 217 break; |
219 | 218 |
220 case AutofillChange::UPDATE: | 219 case AutofillChange::UPDATE: |
221 { | 220 { |
222 sync_api::WriteNode sync_node(trans); | 221 sync_api::WriteNode sync_node(trans); |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 s->set_company_name(UTF16ToUTF8(profile.GetFieldText( | 507 s->set_company_name(UTF16ToUTF8(profile.GetFieldText( |
509 AutoFillType(COMPANY_NAME)))); | 508 AutoFillType(COMPANY_NAME)))); |
510 s->set_phone_fax_whole_number(UTF16ToUTF8(profile.GetFieldText( | 509 s->set_phone_fax_whole_number(UTF16ToUTF8(profile.GetFieldText( |
511 AutoFillType(PHONE_FAX_WHOLE_NUMBER)))); | 510 AutoFillType(PHONE_FAX_WHOLE_NUMBER)))); |
512 s->set_phone_home_whole_number(UTF16ToUTF8(profile.GetFieldText( | 511 s->set_phone_home_whole_number(UTF16ToUTF8(profile.GetFieldText( |
513 AutoFillType(PHONE_HOME_WHOLE_NUMBER)))); | 512 AutoFillType(PHONE_HOME_WHOLE_NUMBER)))); |
514 node->SetAutofillSpecifics(autofill); | 513 node->SetAutofillSpecifics(autofill); |
515 } | 514 } |
516 | 515 |
517 } // namespace browser_sync | 516 } // namespace browser_sync |
OLD | NEW |