| 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 23 matching lines...) Expand all Loading... |
| 34 DCHECK(web_database); | 34 DCHECK(web_database); |
| 35 DCHECK(error_handler); | 35 DCHECK(error_handler); |
| 36 DCHECK(personal_data); | 36 DCHECK(personal_data); |
| 37 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); | 37 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); |
| 38 StartObserving(); | 38 StartObserving(); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void AutofillChangeProcessor::Observe(NotificationType type, | 41 void AutofillChangeProcessor::Observe(NotificationType type, |
| 42 const NotificationSource& source, | 42 const NotificationSource& source, |
| 43 const NotificationDetails& details) { | 43 const NotificationDetails& details) { |
| 44 LOG(INFO) << "Observed autofill change."; | |
| 45 // Ensure this notification came from our web database. | 44 // Ensure this notification came from our web database. |
| 46 WebDataService* wds = Source<WebDataService>(source).ptr(); | 45 WebDataService* wds = Source<WebDataService>(source).ptr(); |
| 47 if (!wds || wds->GetDatabase() != web_database_) | 46 if (!wds || wds->GetDatabase() != web_database_) |
| 48 return; | 47 return; |
| 49 | 48 |
| 50 DCHECK(running()); | 49 DCHECK(running()); |
| 51 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); | 50 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); |
| 52 if (!observing_) | 51 if (!observing_) |
| 53 return; | 52 return; |
| 54 | 53 |
| (...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 s->set_company_name(UTF16ToUTF8(profile.GetFieldText( | 559 s->set_company_name(UTF16ToUTF8(profile.GetFieldText( |
| 561 AutoFillType(COMPANY_NAME)))); | 560 AutoFillType(COMPANY_NAME)))); |
| 562 s->set_phone_fax_whole_number(UTF16ToUTF8(profile.GetFieldText( | 561 s->set_phone_fax_whole_number(UTF16ToUTF8(profile.GetFieldText( |
| 563 AutoFillType(PHONE_FAX_WHOLE_NUMBER)))); | 562 AutoFillType(PHONE_FAX_WHOLE_NUMBER)))); |
| 564 s->set_phone_home_whole_number(UTF16ToUTF8(profile.GetFieldText( | 563 s->set_phone_home_whole_number(UTF16ToUTF8(profile.GetFieldText( |
| 565 AutoFillType(PHONE_HOME_WHOLE_NUMBER)))); | 564 AutoFillType(PHONE_HOME_WHOLE_NUMBER)))); |
| 566 node->SetAutofillSpecifics(autofill); | 565 node->SetAutofillSpecifics(autofill); |
| 567 } | 566 } |
| 568 | 567 |
| 569 } // namespace browser_sync | 568 } // namespace browser_sync |
| OLD | NEW |