Chromium Code Reviews| Index: chrome/browser/ui/passwords/password_manager_presenter.cc |
| diff --git a/chrome/browser/ui/passwords/password_manager_presenter.cc b/chrome/browser/ui/passwords/password_manager_presenter.cc |
| index b332f5120d2fd0f5644c1b2b806e7ed451851079..e28f38ef6a837329d1f6e4e650488cb40310597d 100644 |
| --- a/chrome/browser/ui/passwords/password_manager_presenter.cc |
| +++ b/chrome/browser/ui/passwords/password_manager_presenter.cc |
| @@ -53,6 +53,9 @@ namespace { |
| const char kSortKeyPartsSeparator = ' '; |
| +// The character that is added to a sort key if there is no federation. |
| +const char kSortKeyNoFederationSymbol = '-'; |
| + |
| // Helper function that returns the type of the entry (non-Android credentials, |
| // Android w/ affiliated web realm (i.e. clickable) or w/o web realm). |
| std::string GetEntryTypeCode(bool is_android_uri, bool is_clickable) { |
| @@ -93,8 +96,13 @@ std::string CreateSortKey(const autofill::PasswordForm& form, |
| base::UTF16ToUTF8(form.password_value); |
| if (!form.federation_origin.unique()) |
|
vasilii
2016/11/15 13:18:11
Why don't you just use Origin::Serialize()?
kolos1
2016/11/15 13:57:38
Serialize() returns "null" if there is no federati
vasilii
2016/11/15 14:14:54
If it's important then it should go to a comment o
kolos1
2016/11/15 14:42:51
Done.
|
| key = key + kSortKeyPartsSeparator + form.federation_origin.host(); |
| + else |
| + key = key + kSortKeyPartsSeparator + kSortKeyNoFederationSymbol; |
|
vasilii
2016/11/15 13:18:10
key+= is faster and easier to read.
kolos1
2016/11/15 13:57:38
In this particular case, we cannot use +=, because
vasilii
2016/11/15 14:14:55
key += kSortKeyPartsSeparator;
if ()
key += form
kolos1
2016/11/15 14:42:51
Done.
|
| } |
| + // To separate HTTP/HTTPS credentials, add the scheme to the key. |
| + key += kSortKeyPartsSeparator + link_url.scheme(); |
| + |
| // Since Android and non-Android entries shouldn't be merged into one entry, |
| // add the entry type code to the sort key. |
| key += |