| OLD | NEW |
| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "base/auto_reset.h" | 11 #include "base/auto_reset.h" |
| 12 #include "base/location.h" | 12 #include "base/location.h" |
| 13 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
| 14 #include "base/metrics/histogram_macros.h" | 14 #include "base/metrics/histogram_macros.h" |
| 15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
| 16 #include "components/autofill/core/common/password_form.h" | 16 #include "components/autofill/core/common/password_form.h" |
| 17 #include "components/password_manager/core/browser/password_manager_metrics_util
.h" | 17 #include "components/password_manager/core/browser/password_manager_metrics_util
.h" |
| 18 #include "components/password_manager/core/browser/password_store_sync.h" | 18 #include "components/password_manager/core/browser/password_store_sync.h" |
| 19 #include "components/sync/api/sync_error_factory.h" | 19 #include "components/sync/model/sync_error_factory.h" |
| 20 #include "net/base/escape.h" | 20 #include "net/base/escape.h" |
| 21 | 21 |
| 22 namespace password_manager { | 22 namespace password_manager { |
| 23 | 23 |
| 24 // Converts the |password| into a SyncData object. | 24 // Converts the |password| into a SyncData object. |
| 25 syncer::SyncData SyncDataFromPassword(const autofill::PasswordForm& password); | 25 syncer::SyncData SyncDataFromPassword(const autofill::PasswordForm& password); |
| 26 | 26 |
| 27 // Extracts the |PasswordForm| data from sync's protobuf format. | 27 // Extracts the |PasswordForm| data from sync's protobuf format. |
| 28 autofill::PasswordForm PasswordFromSpecifics( | 28 autofill::PasswordForm PasswordFromSpecifics( |
| 29 const sync_pb::PasswordSpecificsData& password); | 29 const sync_pb::PasswordSpecificsData& password); |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 | 509 |
| 510 std::string MakePasswordSyncTag(const autofill::PasswordForm& password) { | 510 std::string MakePasswordSyncTag(const autofill::PasswordForm& password) { |
| 511 return (net::EscapePath(password.origin.spec()) + "|" + | 511 return (net::EscapePath(password.origin.spec()) + "|" + |
| 512 net::EscapePath(base::UTF16ToUTF8(password.username_element)) + "|" + | 512 net::EscapePath(base::UTF16ToUTF8(password.username_element)) + "|" + |
| 513 net::EscapePath(base::UTF16ToUTF8(password.username_value)) + "|" + | 513 net::EscapePath(base::UTF16ToUTF8(password.username_value)) + "|" + |
| 514 net::EscapePath(base::UTF16ToUTF8(password.password_element)) + "|" + | 514 net::EscapePath(base::UTF16ToUTF8(password.password_element)) + "|" + |
| 515 net::EscapePath(password.signon_realm)); | 515 net::EscapePath(password.signon_realm)); |
| 516 } | 516 } |
| 517 | 517 |
| 518 } // namespace password_manager | 518 } // namespace password_manager |
| OLD | NEW |