| 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/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 const content::NotificationSource& source, | 226 const content::NotificationSource& source, |
| 227 const content::NotificationDetails& details) { | 227 const content::NotificationDetails& details) { |
| 228 DCHECK_EQ(chrome::NOTIFICATION_AUTOFILL_ENTRIES_CHANGED, type); | 228 DCHECK_EQ(chrome::NOTIFICATION_AUTOFILL_ENTRIES_CHANGED, type); |
| 229 | 229 |
| 230 // Check if sync is on. If we receive notification prior to the sync being set | 230 // Check if sync is on. If we receive notification prior to the sync being set |
| 231 // up we are going to process all when MergeData..() is called. If we receive | 231 // up we are going to process all when MergeData..() is called. If we receive |
| 232 // notification after the sync exited, it will be sinced next time Chrome | 232 // notification after the sync exited, it will be sinced next time Chrome |
| 233 // starts. | 233 // starts. |
| 234 if (!sync_processor_.get()) | 234 if (!sync_processor_.get()) |
| 235 return; | 235 return; |
| 236 |
| 236 WebDataService* wds = content::Source<WebDataService>(source).ptr(); | 237 WebDataService* wds = content::Source<WebDataService>(source).ptr(); |
| 237 | 238 |
| 238 DCHECK_EQ(web_data_service_, wds); | 239 DCHECK_EQ(web_data_service_, wds); |
| 239 | 240 |
| 240 AutofillChangeList* changes = | 241 AutofillChangeList* changes = |
| 241 content::Details<AutofillChangeList>(details).ptr(); | 242 content::Details<AutofillChangeList>(details).ptr(); |
| 242 ActOnChanges(*changes); | 243 ActOnChanges(*changes); |
| 243 } | 244 } |
| 244 | 245 |
| 245 bool AutocompleteSyncableService::LoadAutofillData( | 246 bool AutocompleteSyncableService::LoadAutofillData( |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 UTF16ToUTF8(entry.key().value()))); | 386 UTF16ToUTF8(entry.key().value()))); |
| 386 return SyncData::CreateLocalData(tag, tag, autofill_specifics); | 387 return SyncData::CreateLocalData(tag, tag, autofill_specifics); |
| 387 } | 388 } |
| 388 | 389 |
| 389 // static | 390 // static |
| 390 std::string AutocompleteSyncableService::KeyToTag(const std::string& name, | 391 std::string AutocompleteSyncableService::KeyToTag(const std::string& name, |
| 391 const std::string& value) { | 392 const std::string& value) { |
| 392 std::string ns(kAutofillEntryNamespaceTag); | 393 std::string ns(kAutofillEntryNamespaceTag); |
| 393 return ns + net::EscapePath(name) + "|" + net::EscapePath(value); | 394 return ns + net::EscapePath(name) + "|" + net::EscapePath(value); |
| 394 } | 395 } |
| OLD | NEW |