| 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 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 856 return PasswordStore::Init(); | 856 return PasswordStore::Init(); |
| 857 } | 857 } |
| 858 | 858 |
| 859 void PasswordStoreMac::ShutdownOnUIThread() { | 859 void PasswordStoreMac::ShutdownOnUIThread() { |
| 860 } | 860 } |
| 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::SequencedTaskRunner> | 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() { |
| 872 login_metadata_db_->ReportMetrics(); | 872 login_metadata_db_->ReportMetrics(); |
| 873 } | 873 } |
| 874 | 874 |
| 875 void PasswordStoreMac::AddLoginImpl(const PasswordForm& form) { | 875 void PasswordStoreMac::AddLoginImpl(const PasswordForm& form) { |
| 876 if (AddToKeychainIfNecessary(form)) { | 876 if (AddToKeychainIfNecessary(form)) { |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1144 owned_keychain_adapter.SetFindsOnlyOwnedItems(true); | 1144 owned_keychain_adapter.SetFindsOnlyOwnedItems(true); |
| 1145 for (std::vector<PasswordForm*>::const_iterator i = forms.begin(); | 1145 for (std::vector<PasswordForm*>::const_iterator i = forms.begin(); |
| 1146 i != forms.end(); ++i) { | 1146 i != forms.end(); ++i) { |
| 1147 owned_keychain_adapter.RemovePassword(**i); | 1147 owned_keychain_adapter.RemovePassword(**i); |
| 1148 } | 1148 } |
| 1149 } | 1149 } |
| 1150 | 1150 |
| 1151 void PasswordStoreMac::CreateNotificationService() { | 1151 void PasswordStoreMac::CreateNotificationService() { |
| 1152 notification_service_.reset(content::NotificationService::Create()); | 1152 notification_service_.reset(content::NotificationService::Create()); |
| 1153 } | 1153 } |
| OLD | NEW |