| 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_factory.h" | 5 #include "chrome/browser/password_manager/password_store_factory.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 GetForProfile(profile, ServiceAccessType::EXPLICIT_ACCESS); | 90 GetForProfile(profile, ServiceAccessType::EXPLICIT_ACCESS); |
| 91 if (!password_store) | 91 if (!password_store) |
| 92 return; | 92 return; |
| 93 sync_driver::SyncService* sync_service = | 93 sync_driver::SyncService* sync_service = |
| 94 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile); | 94 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile); |
| 95 net::URLRequestContextGetter* request_context_getter = | 95 net::URLRequestContextGetter* request_context_getter = |
| 96 profile->GetRequestContext(); | 96 profile->GetRequestContext(); |
| 97 | 97 |
| 98 password_manager::ToggleAffiliationBasedMatchingBasedOnPasswordSyncedState( | 98 password_manager::ToggleAffiliationBasedMatchingBasedOnPasswordSyncedState( |
| 99 password_store.get(), sync_service, request_context_getter, | 99 password_store.get(), sync_service, request_context_getter, |
| 100 profile->GetPath(), content::BrowserThread::GetMessageLoopProxyForThread( | 100 profile->GetPath(), content::BrowserThread::GetTaskRunnerForThread( |
| 101 content::BrowserThread::DB)); | 101 content::BrowserThread::DB)); |
| 102 } | 102 } |
| 103 | 103 |
| 104 // static | 104 // static |
| 105 void PasswordStoreFactory::TrimOrDeleteAffiliationCache(Profile* profile) { | 105 void PasswordStoreFactory::TrimOrDeleteAffiliationCache(Profile* profile) { |
| 106 scoped_refptr<PasswordStore> password_store = | 106 scoped_refptr<PasswordStore> password_store = |
| 107 GetForProfile(profile, ServiceAccessType::EXPLICIT_ACCESS); | 107 GetForProfile(profile, ServiceAccessType::EXPLICIT_ACCESS); |
| 108 password_manager::TrimOrDeleteAffiliationCacheForStoreAndPath( | 108 password_manager::TrimOrDeleteAffiliationCacheForStoreAndPath( |
| 109 password_store.get(), profile->GetPath(), | 109 password_store.get(), profile->GetPath(), |
| 110 content::BrowserThread::GetMessageLoopProxyForThread( | 110 content::BrowserThread::GetTaskRunnerForThread( |
| 111 content::BrowserThread::DB)); | 111 content::BrowserThread::DB)); |
| 112 } | 112 } |
| 113 | 113 |
| 114 PasswordStoreFactory::PasswordStoreFactory() | 114 PasswordStoreFactory::PasswordStoreFactory() |
| 115 : RefcountedBrowserContextKeyedServiceFactory( | 115 : RefcountedBrowserContextKeyedServiceFactory( |
| 116 "PasswordStore", | 116 "PasswordStore", |
| 117 BrowserContextDependencyManager::GetInstance()) { | 117 BrowserContextDependencyManager::GetInstance()) { |
| 118 DependsOn(WebDataServiceFactory::GetInstance()); | 118 DependsOn(WebDataServiceFactory::GetInstance()); |
| 119 } | 119 } |
| 120 | 120 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 149 password_manager_util_win::DelayReportOsPassword(); | 149 password_manager_util_win::DelayReportOsPassword(); |
| 150 #endif | 150 #endif |
| 151 Profile* profile = static_cast<Profile*>(context); | 151 Profile* profile = static_cast<Profile*>(context); |
| 152 | 152 |
| 153 std::unique_ptr<password_manager::LoginDatabase> login_db( | 153 std::unique_ptr<password_manager::LoginDatabase> login_db( |
| 154 password_manager::CreateLoginDatabase(profile->GetPath())); | 154 password_manager::CreateLoginDatabase(profile->GetPath())); |
| 155 | 155 |
| 156 scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner( | 156 scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner( |
| 157 base::ThreadTaskRunnerHandle::Get()); | 157 base::ThreadTaskRunnerHandle::Get()); |
| 158 scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner( | 158 scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner( |
| 159 content::BrowserThread::GetMessageLoopProxyForThread( | 159 content::BrowserThread::GetTaskRunnerForThread( |
| 160 content::BrowserThread::DB)); | 160 content::BrowserThread::DB)); |
| 161 | 161 |
| 162 scoped_refptr<PasswordStore> ps; | 162 scoped_refptr<PasswordStore> ps; |
| 163 #if defined(OS_WIN) | 163 #if defined(OS_WIN) |
| 164 ps = new PasswordStoreWin(main_thread_runner, db_thread_runner, | 164 ps = new PasswordStoreWin(main_thread_runner, db_thread_runner, |
| 165 std::move(login_db), | 165 std::move(login_db), |
| 166 WebDataServiceFactory::GetPasswordWebDataForProfile( | 166 WebDataServiceFactory::GetPasswordWebDataForProfile( |
| 167 profile, ServiceAccessType::EXPLICIT_ACCESS)); | 167 profile, ServiceAccessType::EXPLICIT_ACCESS)); |
| 168 #elif defined(OS_MACOSX) | 168 #elif defined(OS_MACOSX) |
| 169 std::unique_ptr<crypto::AppleKeychain> keychain( | 169 std::unique_ptr<crypto::AppleKeychain> keychain( |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 break; | 352 break; |
| 353 case LIBSECRET: | 353 case LIBSECRET: |
| 354 usage = OTHER_LIBSECRET; | 354 usage = OTHER_LIBSECRET; |
| 355 break; | 355 break; |
| 356 } | 356 } |
| 357 } | 357 } |
| 358 UMA_HISTOGRAM_ENUMERATION("PasswordManager.LinuxBackendStatistics", usage, | 358 UMA_HISTOGRAM_ENUMERATION("PasswordManager.LinuxBackendStatistics", usage, |
| 359 MAX_BACKEND_USAGE_VALUE); | 359 MAX_BACKEND_USAGE_VALUE); |
| 360 } | 360 } |
| 361 #endif | 361 #endif |
| OLD | NEW |