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

Unified Diff: components/password_manager/sync/browser/password_sync_util.cc

Issue 2233833002: Accept empty username as sync username in IsSyncAccountCredential (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/password_manager/sync/browser/password_sync_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/password_manager/sync/browser/password_sync_util.cc
diff --git a/components/password_manager/sync/browser/password_sync_util.cc b/components/password_manager/sync/browser/password_sync_util.cc
index 19292c5811c303394ff686b6cca8fc7358a5737d..9eadfdf4f1cb38964bf135af39c59e9847fc5e4f 100644
--- a/components/password_manager/sync/browser/password_sync_util.cc
+++ b/components/password_manager/sync/browser/password_sync_util.cc
@@ -39,6 +39,12 @@ bool IsSyncAccountCredential(const autofill::PasswordForm& form,
return false;
}
+ // The empty username can mean that Chrome did not detect it correctly. For
+ // reasons described in http://crbug.com/636292#c1, the username is suspected
+ // to be the sync username unless proven otherwise.
+ if (form.username_value.empty())
+ return true;
+
return gaia::AreEmailsSame(
base::UTF16ToUTF8(form.username_value),
GetSyncUsernameIfSyncingPasswords(sync_service, signin_manager));
« no previous file with comments | « no previous file | components/password_manager/sync/browser/password_sync_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698