| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/webdata/autocomplete_syncable_service.h" | 5 #include "chrome/browser/webdata/autocomplete_syncable_service.h" |
| 6 | 6 |
| 7 #include "base/location.h" | 7 #include "base/location.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "components/autofill/core/browser/webdata/autofill_table.h" | 10 #include "components/autofill/core/browser/webdata/autofill_table.h" |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 return current_data; | 231 return current_data; |
| 232 } | 232 } |
| 233 | 233 |
| 234 syncer::SyncError AutocompleteSyncableService::ProcessSyncChanges( | 234 syncer::SyncError AutocompleteSyncableService::ProcessSyncChanges( |
| 235 const tracked_objects::Location& from_here, | 235 const tracked_objects::Location& from_here, |
| 236 const syncer::SyncChangeList& change_list) { | 236 const syncer::SyncChangeList& change_list) { |
| 237 DCHECK(CalledOnValidThread()); | 237 DCHECK(CalledOnValidThread()); |
| 238 DCHECK(sync_processor_.get()); | 238 DCHECK(sync_processor_.get()); |
| 239 | 239 |
| 240 if (!sync_processor_.get()) { | 240 if (!sync_processor_.get()) { |
| 241 syncer::SyncError error(FROM_HERE, "Models not yet associated.", | 241 syncer::SyncError error(FROM_HERE, |
| 242 syncer::AUTOFILL); | 242 syncer::SyncError::DATATYPE_ERROR, |
| 243 "Models not yet associated.", |
| 244 syncer::AUTOFILL); |
| 243 return error; | 245 return error; |
| 244 } | 246 } |
| 245 | 247 |
| 246 // Data is loaded only if we get new ADD/UPDATE change. | 248 // Data is loaded only if we get new ADD/UPDATE change. |
| 247 std::vector<AutofillEntry> entries; | 249 std::vector<AutofillEntry> entries; |
| 248 scoped_ptr<AutocompleteEntryMap> db_entries; | 250 scoped_ptr<AutocompleteEntryMap> db_entries; |
| 249 std::vector<AutofillEntry> new_entries; | 251 std::vector<AutofillEntry> new_entries; |
| 250 | 252 |
| 251 syncer::SyncError list_processing_error; | 253 syncer::SyncError list_processing_error; |
| 252 | 254 |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 UTF16ToUTF8(entry.key().value()))); | 485 UTF16ToUTF8(entry.key().value()))); |
| 484 return syncer::SyncData::CreateLocalData(tag, tag, autofill_specifics); | 486 return syncer::SyncData::CreateLocalData(tag, tag, autofill_specifics); |
| 485 } | 487 } |
| 486 | 488 |
| 487 // static | 489 // static |
| 488 std::string AutocompleteSyncableService::KeyToTag(const std::string& name, | 490 std::string AutocompleteSyncableService::KeyToTag(const std::string& name, |
| 489 const std::string& value) { | 491 const std::string& value) { |
| 490 std::string ns(kAutofillEntryNamespaceTag); | 492 std::string ns(kAutofillEntryNamespaceTag); |
| 491 return ns + net::EscapePath(name) + "|" + net::EscapePath(value); | 493 return ns + net::EscapePath(name) + "|" + net::EscapePath(value); |
| 492 } | 494 } |
| OLD | NEW |