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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/environment.h" | 8 #include "base/environment.h" |
9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 PasswordStoreFactory* factory = GetInstance(); | 165 PasswordStoreFactory* factory = GetInstance(); |
166 PasswordStoreService* service = static_cast<PasswordStoreService*>( | 166 PasswordStoreService* service = static_cast<PasswordStoreService*>( |
167 factory->GetServiceForBrowserContext(profile, true)); | 167 factory->GetServiceForBrowserContext(profile, true)); |
168 if (!service) | 168 if (!service) |
169 return nullptr; | 169 return nullptr; |
170 return service->GetPasswordStore(); | 170 return service->GetPasswordStore(); |
171 } | 171 } |
172 | 172 |
173 // static | 173 // static |
174 PasswordStoreFactory* PasswordStoreFactory::GetInstance() { | 174 PasswordStoreFactory* PasswordStoreFactory::GetInstance() { |
175 return Singleton<PasswordStoreFactory>::get(); | 175 return base::Singleton<PasswordStoreFactory>::get(); |
176 } | 176 } |
177 | 177 |
178 // static | 178 // static |
179 void PasswordStoreFactory::OnPasswordsSyncedStatePotentiallyChanged( | 179 void PasswordStoreFactory::OnPasswordsSyncedStatePotentiallyChanged( |
180 Profile* profile) { | 180 Profile* profile) { |
181 scoped_refptr<PasswordStore> password_store = | 181 scoped_refptr<PasswordStore> password_store = |
182 GetForProfile(profile, ServiceAccessType::EXPLICIT_ACCESS); | 182 GetForProfile(profile, ServiceAccessType::EXPLICIT_ACCESS); |
183 if (!password_store) | 183 if (!password_store) |
184 return; | 184 return; |
185 | 185 |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 break; | 448 break; |
449 case LIBSECRET: | 449 case LIBSECRET: |
450 usage = OTHER_LIBSECRET; | 450 usage = OTHER_LIBSECRET; |
451 break; | 451 break; |
452 } | 452 } |
453 } | 453 } |
454 UMA_HISTOGRAM_ENUMERATION("PasswordManager.LinuxBackendStatistics", usage, | 454 UMA_HISTOGRAM_ENUMERATION("PasswordManager.LinuxBackendStatistics", usage, |
455 MAX_BACKEND_USAGE_VALUE); | 455 MAX_BACKEND_USAGE_VALUE); |
456 } | 456 } |
457 #endif | 457 #endif |
OLD | NEW |