| Index: chrome/browser/password_manager/password_syncable_service.cc
|
| diff --git a/chrome/browser/password_manager/password_syncable_service.cc b/chrome/browser/password_manager/password_syncable_service.cc
|
| index 67355e2a9668629a1af517a96612ca85160b350c..97e83414412fa89268967858c515ef6c78b39cf1 100644
|
| --- a/chrome/browser/password_manager/password_syncable_service.cc
|
| +++ b/chrome/browser/password_manager/password_syncable_service.cc
|
| @@ -11,74 +11,6 @@
|
| #include "net/base/escape.h"
|
| #include "sync/api/sync_error_factory.h"
|
|
|
| -namespace {
|
| -
|
| -// Converts the |PasswordSpecifics| obtained from sync to an
|
| -// object of type |PasswordForm|.
|
| -void ExtractPasswordFromSpecifics(
|
| - const sync_pb::PasswordSpecificsData& password,
|
| - autofill::PasswordForm* new_password) {
|
| - new_password->scheme =
|
| - static_cast<autofill::PasswordForm::Scheme>(password.scheme());
|
| - new_password->signon_realm = password.signon_realm();
|
| - new_password->origin = GURL(password.origin());
|
| - new_password->action = GURL(password.action());
|
| - new_password->username_element =
|
| - UTF8ToUTF16(password.username_element());
|
| - new_password->password_element =
|
| - UTF8ToUTF16(password.password_element());
|
| - new_password->username_value =
|
| - UTF8ToUTF16(password.username_value());
|
| - new_password->password_value =
|
| - UTF8ToUTF16(password.password_value());
|
| - new_password->ssl_valid = password.ssl_valid();
|
| - new_password->preferred = password.preferred();
|
| - new_password->date_created =
|
| - base::Time::FromInternalValue(password.date_created());
|
| - new_password->blacklisted_by_user =
|
| - password.blacklisted();
|
| -}
|
| -
|
| -// Merges the sync password (obtained from the password specifics) and
|
| -// local password and stores the output in the |new_password_form| pointer.
|
| -bool MergeLocalAndSyncPasswords(
|
| - const sync_pb::PasswordSpecificsData& password_specifics,
|
| - const autofill::PasswordForm& password_form,
|
| - autofill::PasswordForm* new_password_form) {
|
| - if (password_specifics.scheme() == password_form.scheme &&
|
| - password_form.signon_realm == password_specifics.signon_realm() &&
|
| - password_form.origin.spec() == password_specifics.origin() &&
|
| - password_form.action.spec() == password_specifics.action() &&
|
| - UTF16ToUTF8(password_form.username_element) ==
|
| - password_specifics.username_element() &&
|
| - UTF16ToUTF8(password_form.password_element) ==
|
| - password_specifics.password_element() &&
|
| - UTF16ToUTF8(password_form.username_value) ==
|
| - password_specifics.username_value() &&
|
| - UTF16ToUTF8(password_form.password_value) ==
|
| - password_specifics.password_value() &&
|
| - password_specifics.ssl_valid() == password_form.ssl_valid &&
|
| - password_specifics.preferred() == password_form.preferred &&
|
| - password_specifics.date_created() ==
|
| - password_form.date_created.ToInternalValue() &&
|
| - password_specifics.blacklisted() ==
|
| - password_form.blacklisted_by_user) {
|
| - return false;
|
| - }
|
| -
|
| - // If the passwords differ, take the one that was created more recently.
|
| - if (base::Time::FromInternalValue(password_specifics.date_created()) <=
|
| - password_form.date_created) {
|
| - *new_password_form = password_form;
|
| - } else {
|
| - ExtractPasswordFromSpecifics(password_specifics, new_password_form);
|
| - }
|
| -
|
| - return true;
|
| -}
|
| -
|
| -} // namespace
|
| -
|
| PasswordSyncableService::PasswordSyncableService(
|
| scoped_refptr<PasswordStore> password_store)
|
| : password_store_(password_store) {
|
|
|