OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
319 sync_api::WriteNode* node) { | 319 sync_api::WriteNode* node) { |
320 sync_pb::AutofillProfileSpecifics specifics; | 320 sync_pb::AutofillProfileSpecifics specifics; |
321 | 321 |
322 // This would get compiled out in official builds. The caller is expected to | 322 // This would get compiled out in official builds. The caller is expected to |
323 // pass in a valid profile object with valid guid.(i.e., the caller might | 323 // pass in a valid profile object with valid guid.(i.e., the caller might |
324 // have to a DCHECK and log before calling. Having to check in 2 places is | 324 // have to a DCHECK and log before calling. Having to check in 2 places is |
325 // not optimal.) | 325 // not optimal.) |
326 DCHECK(guid::IsValidGUID(profile.guid())); | 326 DCHECK(guid::IsValidGUID(profile.guid())); |
327 | 327 |
328 specifics.set_guid(profile.guid()); | 328 specifics.set_guid(profile.guid()); |
329 specifics.set_name_first(UTF16ToUTF8( | 329 specifics.set_name_first(UTF16ToUTF8( |
dhollowa
2011/03/16 17:07:11
nit: A number of these should fit on single line n
Ilya Sherman
2011/03/17 03:42:29
Done.
| |
330 profile.GetFieldText(AutofillType(NAME_FIRST)))); | 330 profile.GetFieldText(NAME_FIRST))); |
331 specifics.set_name_middle(UTF16ToUTF8( | 331 specifics.set_name_middle(UTF16ToUTF8( |
332 profile.GetFieldText(AutofillType(NAME_MIDDLE)))); | 332 profile.GetFieldText(NAME_MIDDLE))); |
333 specifics.set_name_last( | 333 specifics.set_name_last( |
334 UTF16ToUTF8(profile.GetFieldText(AutofillType(NAME_LAST)))); | 334 UTF16ToUTF8(profile.GetFieldText(NAME_LAST))); |
335 specifics.set_address_home_line1( | 335 specifics.set_address_home_line1( |
336 UTF16ToUTF8(profile.GetFieldText(AutofillType(ADDRESS_HOME_LINE1)))); | 336 UTF16ToUTF8(profile.GetFieldText(ADDRESS_HOME_LINE1))); |
337 specifics.set_address_home_line2( | 337 specifics.set_address_home_line2( |
338 UTF16ToUTF8(profile.GetFieldText(AutofillType(ADDRESS_HOME_LINE2)))); | 338 UTF16ToUTF8(profile.GetFieldText(ADDRESS_HOME_LINE2))); |
339 specifics.set_address_home_city(UTF16ToUTF8(profile.GetFieldText( | 339 specifics.set_address_home_city(UTF16ToUTF8(profile.GetFieldText( |
340 AutofillType(ADDRESS_HOME_CITY)))); | 340 ADDRESS_HOME_CITY))); |
341 specifics.set_address_home_state(UTF16ToUTF8(profile.GetFieldText( | 341 specifics.set_address_home_state(UTF16ToUTF8(profile.GetFieldText( |
342 AutofillType(ADDRESS_HOME_STATE)))); | 342 ADDRESS_HOME_STATE))); |
343 specifics.set_address_home_country(UTF16ToUTF8(profile.GetFieldText( | 343 specifics.set_address_home_country(UTF16ToUTF8(profile.GetFieldText( |
344 AutofillType(ADDRESS_HOME_COUNTRY)))); | 344 ADDRESS_HOME_COUNTRY))); |
345 specifics.set_address_home_zip(UTF16ToUTF8(profile.GetFieldText( | 345 specifics.set_address_home_zip(UTF16ToUTF8(profile.GetFieldText( |
346 AutofillType(ADDRESS_HOME_ZIP)))); | 346 ADDRESS_HOME_ZIP))); |
347 specifics.set_email_address(UTF16ToUTF8(profile.GetFieldText( | 347 specifics.set_email_address(UTF16ToUTF8(profile.GetFieldText( |
348 AutofillType(EMAIL_ADDRESS)))); | 348 EMAIL_ADDRESS))); |
349 specifics.set_company_name(UTF16ToUTF8(profile.GetFieldText( | 349 specifics.set_company_name(UTF16ToUTF8(profile.GetFieldText( |
350 AutofillType(COMPANY_NAME)))); | 350 COMPANY_NAME))); |
351 specifics.set_phone_fax_whole_number(UTF16ToUTF8(profile.GetFieldText( | 351 specifics.set_phone_fax_whole_number(UTF16ToUTF8(profile.GetFieldText( |
352 AutofillType(PHONE_FAX_WHOLE_NUMBER)))); | 352 PHONE_FAX_WHOLE_NUMBER))); |
353 specifics.set_phone_home_whole_number(UTF16ToUTF8(profile.GetFieldText( | 353 specifics.set_phone_home_whole_number(UTF16ToUTF8(profile.GetFieldText( |
354 AutofillType(PHONE_HOME_WHOLE_NUMBER)))); | 354 PHONE_HOME_WHOLE_NUMBER))); |
355 node->SetAutofillProfileSpecifics(specifics); | 355 node->SetAutofillProfileSpecifics(specifics); |
356 } | 356 } |
357 | 357 |
358 } // namespace browser_sync | 358 } // namespace browser_sync |
OLD | NEW |