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

Side by Side Diff: components/password_manager/core/browser/password_manager_util.cc

Issue 2716583003: Rename Origin.unique() to opaque().
Patch Set: Update new uses post-rebase Created 3 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 unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698