| 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/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 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 861 | 861 |
| 862 // Mac stores passwords in the system keychain, which can block for an | 862 // Mac stores passwords in the system keychain, which can block for an |
| 863 // arbitrarily long time (most notably, it can block on user confirmation | 863 // arbitrarily long time (most notably, it can block on user confirmation |
| 864 // from a dialog). Run tasks on a dedicated thread to avoid blocking the DB | 864 // from a dialog). Run tasks on a dedicated thread to avoid blocking the DB |
| 865 // thread. | 865 // thread. |
| 866 scoped_refptr<base::SingleThreadTaskRunner> | 866 scoped_refptr<base::SingleThreadTaskRunner> |
| 867 PasswordStoreMac::GetBackgroundTaskRunner() { | 867 PasswordStoreMac::GetBackgroundTaskRunner() { |
| 868 return (thread_.get()) ? thread_->message_loop_proxy() : NULL; | 868 return (thread_.get()) ? thread_->message_loop_proxy() : NULL; |
| 869 } | 869 } |
| 870 | 870 |
| 871 void PasswordStoreMac::ReportMetricsImpl() { | 871 void PasswordStoreMac::ReportMetricsImpl(const std::string& sync_username) { |
| 872 login_metadata_db_->ReportMetrics(); | 872 login_metadata_db_->ReportMetrics(sync_username); |
| 873 } | 873 } |
| 874 | 874 |
| 875 PasswordStoreChangeList PasswordStoreMac::AddLoginImpl( | 875 PasswordStoreChangeList PasswordStoreMac::AddLoginImpl( |
| 876 const PasswordForm& form) { | 876 const PasswordForm& form) { |
| 877 DCHECK(thread_->message_loop() == base::MessageLoop::current()); | 877 DCHECK(thread_->message_loop() == base::MessageLoop::current()); |
| 878 PasswordStoreChangeList changes; | 878 PasswordStoreChangeList changes; |
| 879 if (AddToKeychainIfNecessary(form)) { | 879 if (AddToKeychainIfNecessary(form)) { |
| 880 changes = login_metadata_db_->AddLogin(form); | 880 changes = login_metadata_db_->AddLogin(form); |
| 881 } | 881 } |
| 882 return changes; | 882 return changes; |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1154 | 1154 |
| 1155 void PasswordStoreMac::RemoveKeychainForms( | 1155 void PasswordStoreMac::RemoveKeychainForms( |
| 1156 const std::vector<PasswordForm*>& forms) { | 1156 const std::vector<PasswordForm*>& forms) { |
| 1157 MacKeychainPasswordFormAdapter owned_keychain_adapter(keychain_.get()); | 1157 MacKeychainPasswordFormAdapter owned_keychain_adapter(keychain_.get()); |
| 1158 owned_keychain_adapter.SetFindsOnlyOwnedItems(true); | 1158 owned_keychain_adapter.SetFindsOnlyOwnedItems(true); |
| 1159 for (std::vector<PasswordForm*>::const_iterator i = forms.begin(); | 1159 for (std::vector<PasswordForm*>::const_iterator i = forms.begin(); |
| 1160 i != forms.end(); ++i) { | 1160 i != forms.end(); ++i) { |
| 1161 owned_keychain_adapter.RemovePassword(**i); | 1161 owned_keychain_adapter.RemovePassword(**i); |
| 1162 } | 1162 } |
| 1163 } | 1163 } |
| OLD | NEW |