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/rand_util.h" | 9 #include "base/rand_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 const content::NotificationSource& source, | 306 const content::NotificationSource& source, |
307 const content::NotificationDetails& details) { | 307 const content::NotificationDetails& details) { |
308 DCHECK_EQ(chrome::NOTIFICATION_AUTOFILL_ENTRIES_CHANGED, type); | 308 DCHECK_EQ(chrome::NOTIFICATION_AUTOFILL_ENTRIES_CHANGED, type); |
309 | 309 |
310 // Check if sync is on. If we receive notification prior to the sync being set | 310 // Check if sync is on. If we receive notification prior to the sync being set |
311 // up we are going to process all when MergeData..() is called. If we receive | 311 // up we are going to process all when MergeData..() is called. If we receive |
312 // notification after the sync exited, it will be sinced next time Chrome | 312 // notification after the sync exited, it will be sinced next time Chrome |
313 // starts. | 313 // starts. |
314 if (!sync_processor_.get()) | 314 if (!sync_processor_.get()) |
315 return; | 315 return; |
| 316 |
316 WebDataService* wds = content::Source<WebDataService>(source).ptr(); | 317 WebDataService* wds = content::Source<WebDataService>(source).ptr(); |
317 | 318 |
318 DCHECK_EQ(web_data_service_, wds); | 319 DCHECK_EQ(web_data_service_, wds); |
319 | 320 |
320 AutofillChangeList* changes = | 321 AutofillChangeList* changes = |
321 content::Details<AutofillChangeList>(details).ptr(); | 322 content::Details<AutofillChangeList>(details).ptr(); |
322 ActOnChanges(*changes); | 323 ActOnChanges(*changes); |
323 } | 324 } |
324 | 325 |
325 bool AutocompleteSyncableService::LoadAutofillData( | 326 bool AutocompleteSyncableService::LoadAutofillData( |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 UTF16ToUTF8(entry.key().value()))); | 482 UTF16ToUTF8(entry.key().value()))); |
482 return SyncData::CreateLocalData(tag, tag, autofill_specifics); | 483 return SyncData::CreateLocalData(tag, tag, autofill_specifics); |
483 } | 484 } |
484 | 485 |
485 // static | 486 // static |
486 std::string AutocompleteSyncableService::KeyToTag(const std::string& name, | 487 std::string AutocompleteSyncableService::KeyToTag(const std::string& name, |
487 const std::string& value) { | 488 const std::string& value) { |
488 std::string ns(kAutofillEntryNamespaceTag); | 489 std::string ns(kAutofillEntryNamespaceTag); |
489 return ns + net::EscapePath(name) + "|" + net::EscapePath(value); | 490 return ns + net::EscapePath(name) + "|" + net::EscapePath(value); |
490 } | 491 } |
OLD | NEW |