Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: components/password_manager/core/browser/password_syncable_service.cc

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/password_manager/core/browser/password_syncable_service.h" 5 #include "components/password_manager/core/browser/password_syncable_service.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/location.h" 10 #include "base/location.h"
11 #include "base/memory/scoped_vector.h" 11 #include "base/memory/scoped_vector.h"
12 #include "base/metrics/histogram_macros.h" 12 #include "base/metrics/histogram_macros.h"
13 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
14 #include "components/autofill/core/common/password_form.h" 14 #include "components/autofill/core/common/password_form.h"
15 #include "components/password_manager/core/browser/password_manager_metrics_util .h" 15 #include "components/password_manager/core/browser/password_manager_metrics_util .h"
16 #include "components/password_manager/core/browser/password_store_sync.h" 16 #include "components/password_manager/core/browser/password_store_sync.h"
17 #include "components/sync/api/sync_error_factory.h"
17 #include "net/base/escape.h" 18 #include "net/base/escape.h"
18 #include "sync/api/sync_error_factory.h"
19 19
20 namespace password_manager { 20 namespace password_manager {
21 21
22 // Converts the |password| into a SyncData object. 22 // Converts the |password| into a SyncData object.
23 syncer::SyncData SyncDataFromPassword(const autofill::PasswordForm& password); 23 syncer::SyncData SyncDataFromPassword(const autofill::PasswordForm& password);
24 24
25 // Extracts the |PasswordForm| data from sync's protobuf format. 25 // Extracts the |PasswordForm| data from sync's protobuf format.
26 autofill::PasswordForm PasswordFromSpecifics( 26 autofill::PasswordForm PasswordFromSpecifics(
27 const sync_pb::PasswordSpecificsData& password); 27 const sync_pb::PasswordSpecificsData& password);
28 28
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 506
507 std::string MakePasswordSyncTag(const autofill::PasswordForm& password) { 507 std::string MakePasswordSyncTag(const autofill::PasswordForm& password) {
508 return (net::EscapePath(password.origin.spec()) + "|" + 508 return (net::EscapePath(password.origin.spec()) + "|" +
509 net::EscapePath(base::UTF16ToUTF8(password.username_element)) + "|" + 509 net::EscapePath(base::UTF16ToUTF8(password.username_element)) + "|" +
510 net::EscapePath(base::UTF16ToUTF8(password.username_value)) + "|" + 510 net::EscapePath(base::UTF16ToUTF8(password.username_value)) + "|" +
511 net::EscapePath(base::UTF16ToUTF8(password.password_element)) + "|" + 511 net::EscapePath(base::UTF16ToUTF8(password.password_element)) + "|" +
512 net::EscapePath(password.signon_realm)); 512 net::EscapePath(password.signon_realm));
513 } 513 }
514 514
515 } // namespace password_manager 515 } // namespace password_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698