OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_manager_util.h" | 5 #include "components/password_manager/core/browser/password_manager_util.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 forms->swap(unique_forms); | 61 forms->swap(unique_forms); |
62 } | 62 } |
63 | 63 |
64 void TrimUsernameOnlyCredentials( | 64 void TrimUsernameOnlyCredentials( |
65 std::vector<std::unique_ptr<autofill::PasswordForm>>* android_credentials) { | 65 std::vector<std::unique_ptr<autofill::PasswordForm>>* android_credentials) { |
66 // Remove username-only credentials which are not federated. | 66 // Remove username-only credentials which are not federated. |
67 base::EraseIf(*android_credentials, | 67 base::EraseIf(*android_credentials, |
68 [](const std::unique_ptr<autofill::PasswordForm>& form) { | 68 [](const std::unique_ptr<autofill::PasswordForm>& form) { |
69 return form->scheme == | 69 return form->scheme == |
70 autofill::PasswordForm::SCHEME_USERNAME_ONLY && | 70 autofill::PasswordForm::SCHEME_USERNAME_ONLY && |
71 form->federation_origin.unique(); | 71 form->federation_origin.opaque(); |
72 }); | 72 }); |
73 | 73 |
74 // Set "skip_zero_click" on federated credentials. | 74 // Set "skip_zero_click" on federated credentials. |
75 std::for_each( | 75 std::for_each( |
76 android_credentials->begin(), android_credentials->end(), | 76 android_credentials->begin(), android_credentials->end(), |
77 [](const std::unique_ptr<autofill::PasswordForm>& form) { | 77 [](const std::unique_ptr<autofill::PasswordForm>& form) { |
78 if (form->scheme == autofill::PasswordForm::SCHEME_USERNAME_ONLY) | 78 if (form->scheme == autofill::PasswordForm::SCHEME_USERNAME_ONLY) |
79 form->skip_zero_click = true; | 79 form->skip_zero_click = true; |
80 }); | 80 }); |
81 } | 81 } |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 uint64_t hash37 = ((static_cast<uint64_t>(hash[0]))) | | 113 uint64_t hash37 = ((static_cast<uint64_t>(hash[0]))) | |
114 ((static_cast<uint64_t>(hash[1])) << 8) | | 114 ((static_cast<uint64_t>(hash[1])) << 8) | |
115 ((static_cast<uint64_t>(hash[2])) << 16) | | 115 ((static_cast<uint64_t>(hash[2])) << 16) | |
116 ((static_cast<uint64_t>(hash[3])) << 24) | | 116 ((static_cast<uint64_t>(hash[3])) << 24) | |
117 (((static_cast<uint64_t>(hash[4])) & 0x1F) << 32); | 117 (((static_cast<uint64_t>(hash[4])) & 0x1F) << 32); |
118 | 118 |
119 return hash37; | 119 return hash37; |
120 } | 120 } |
121 | 121 |
122 } // namespace password_manager_util | 122 } // namespace password_manager_util |
OLD | NEW |