OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/password_store_mac.h" | 5 #include "chrome/browser/password_manager/password_store_mac.h" |
6 #include "chrome/browser/password_manager/password_store_mac_internal.h" | 6 #include "chrome/browser/password_manager/password_store_mac_internal.h" |
7 | 7 |
8 #include <CoreServices/CoreServices.h> | 8 #include <CoreServices/CoreServices.h> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 const PasswordForm& query_form) { | 509 const PasswordForm& query_form) { |
510 std::string username = UTF16ToUTF8(query_form.username_value); | 510 std::string username = UTF16ToUTF8(query_form.username_value); |
511 std::vector<SecKeychainItemRef> matches = | 511 std::vector<SecKeychainItemRef> matches = |
512 MatchingKeychainItems(query_form.signon_realm, query_form.scheme, | 512 MatchingKeychainItems(query_form.signon_realm, query_form.scheme, |
513 NULL, username.c_str()); | 513 NULL, username.c_str()); |
514 for (std::vector<SecKeychainItemRef>::iterator i = matches.begin(); | 514 for (std::vector<SecKeychainItemRef>::iterator i = matches.begin(); |
515 i != matches.end(); ++i) { | 515 i != matches.end(); ++i) { |
516 keychain_->Free(*i); | 516 keychain_->Free(*i); |
517 } | 517 } |
518 | 518 |
519 return matches.size() != 0; | 519 return !matches.empty(); |
520 } | 520 } |
521 | 521 |
522 std::vector<PasswordForm*> | 522 std::vector<PasswordForm*> |
523 MacKeychainPasswordFormAdapter::GetAllPasswordFormPasswords() { | 523 MacKeychainPasswordFormAdapter::GetAllPasswordFormPasswords() { |
524 SecAuthenticationType supported_auth_types[] = { | 524 SecAuthenticationType supported_auth_types[] = { |
525 kSecAuthenticationTypeHTMLForm, | 525 kSecAuthenticationTypeHTMLForm, |
526 kSecAuthenticationTypeHTTPBasic, | 526 kSecAuthenticationTypeHTTPBasic, |
527 kSecAuthenticationTypeHTTPDigest, | 527 kSecAuthenticationTypeHTTPDigest, |
528 }; | 528 }; |
529 | 529 |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1004 owned_keychain_adapter.SetFindsOnlyOwnedItems(true); | 1004 owned_keychain_adapter.SetFindsOnlyOwnedItems(true); |
1005 for (std::vector<PasswordForm*>::const_iterator i = forms.begin(); | 1005 for (std::vector<PasswordForm*>::const_iterator i = forms.begin(); |
1006 i != forms.end(); ++i) { | 1006 i != forms.end(); ++i) { |
1007 owned_keychain_adapter.RemovePassword(**i); | 1007 owned_keychain_adapter.RemovePassword(**i); |
1008 } | 1008 } |
1009 } | 1009 } |
1010 | 1010 |
1011 void PasswordStoreMac::CreateNotificationService() { | 1011 void PasswordStoreMac::CreateNotificationService() { |
1012 notification_service_.reset(new NotificationService); | 1012 notification_service_.reset(new NotificationService); |
1013 } | 1013 } |
OLD | NEW |