OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/password_manager/native_backend_gnome_x.h" | 5 #include "chrome/browser/password_manager/native_backend_gnome_x.h" |
6 | 6 |
7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
8 #include <gnome-keyring.h> | 8 #include <gnome-keyring.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
187 form->password_value = UTF8ToUTF16(data->secret); | 187 form->password_value = UTF8ToUTF16(data->secret); |
188 } else { | 188 } else { |
189 LOG(WARNING) << "Unable to access password from list element!"; | 189 LOG(WARNING) << "Unable to access password from list element!"; |
190 } | 190 } |
191 forms->push_back(form.release()); | 191 forms->push_back(form.release()); |
192 } else { | 192 } else { |
193 LOG(WARNING) << "Could not initialize PasswordForm from attributes!"; | 193 LOG(WARNING) << "Could not initialize PasswordForm from attributes!"; |
194 } | 194 } |
195 } | 195 } |
196 if (lookup_form) { | 196 if (lookup_form) { |
197 const GURL signon_realm(lookup_form->signon_realm); | |
198 std::string registered_domain = | |
199 PSLMatchingHelper::GetRegistryControlledDomain(signon_realm); | |
197 UMA_HISTOGRAM_ENUMERATION( | 200 UMA_HISTOGRAM_ENUMERATION( |
198 "PasswordManager.PslDomainMatchTriggering", | 201 "PasswordManager.PslDomainMatchTriggering", |
199 helper.IsMatchingEnabled() | 202 helper.ShouldPSLDomainMatchingApply(registered_domain) |
200 ? psl_domain_match_metric | 203 ? psl_domain_match_metric |
201 : PSLMatchingHelper::PSL_DOMAIN_MATCH_DISABLED, | 204 : PSLMatchingHelper::PSL_DOMAIN_MATCH_DISABLED, |
nyquist
2014/08/27 18:15:14
This else-clause looks a bit off to me. It's not d
vabr (Chromium)
2014/09/22 13:32:31
There is no other disabling than not triggering, a
nyquist
2014/09/22 22:59:48
No, I think it would only be a name change. Up to
vabr (Chromium)
2014/09/23 08:31:50
I went with changing "disabled" to a more generic
| |
202 PSLMatchingHelper::PSL_DOMAIN_MATCH_COUNT); | 205 PSLMatchingHelper::PSL_DOMAIN_MATCH_COUNT); |
203 } | 206 } |
204 } | 207 } |
205 | 208 |
206 // Schema is analagous to the fields in PasswordForm. | 209 // Schema is analagous to the fields in PasswordForm. |
207 // TODO(gcasto): Adding 'form_data' would be nice, but we would need to | 210 // TODO(gcasto): Adding 'form_data' would be nice, but we would need to |
208 // serialize in a way that is guaranteed to not have any embedded NULLs. Pickle | 211 // serialize in a way that is guaranteed to not have any embedded NULLs. Pickle |
209 // doesn't make this guarantee, so we just don't serialize this field. Since | 212 // doesn't make this guarantee, so we just don't serialize this field. Since |
210 // it's only used to crowd source data collection it doesn't matter that much | 213 // it's only used to crowd source data collection it doesn't matter that much |
211 // if it's not available on this platform. | 214 // if it's not available on this platform. |
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
787 } | 790 } |
788 return ok; | 791 return ok; |
789 } | 792 } |
790 | 793 |
791 std::string NativeBackendGnome::GetProfileSpecificAppString() const { | 794 std::string NativeBackendGnome::GetProfileSpecificAppString() const { |
792 // Originally, the application string was always just "chrome" and used only | 795 // Originally, the application string was always just "chrome" and used only |
793 // so that we had *something* to search for since GNOME Keyring won't search | 796 // so that we had *something* to search for since GNOME Keyring won't search |
794 // for nothing. Now we use it to distinguish passwords for different profiles. | 797 // for nothing. Now we use it to distinguish passwords for different profiles. |
795 return base::StringPrintf("%s-%d", kGnomeKeyringAppString, profile_id_); | 798 return base::StringPrintf("%s-%d", kGnomeKeyringAppString, profile_id_); |
796 } | 799 } |
OLD | NEW |