| 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/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 PasswordStoreFactory* factory = GetInstance(); | 148 PasswordStoreFactory* factory = GetInstance(); |
| 149 PasswordStoreService* service = static_cast<PasswordStoreService*>( | 149 PasswordStoreService* service = static_cast<PasswordStoreService*>( |
| 150 factory->GetServiceForBrowserContext(profile, true)); | 150 factory->GetServiceForBrowserContext(profile, true)); |
| 151 if (!service) | 151 if (!service) |
| 152 return nullptr; | 152 return nullptr; |
| 153 return service->GetPasswordStore(); | 153 return service->GetPasswordStore(); |
| 154 } | 154 } |
| 155 | 155 |
| 156 // static | 156 // static |
| 157 PasswordStoreFactory* PasswordStoreFactory::GetInstance() { | 157 PasswordStoreFactory* PasswordStoreFactory::GetInstance() { |
| 158 return Singleton<PasswordStoreFactory>::get(); | 158 return base::Singleton<PasswordStoreFactory>::get(); |
| 159 } | 159 } |
| 160 | 160 |
| 161 // static | 161 // static |
| 162 void PasswordStoreFactory::OnPasswordsSyncedStatePotentiallyChanged( | 162 void PasswordStoreFactory::OnPasswordsSyncedStatePotentiallyChanged( |
| 163 Profile* profile) { | 163 Profile* profile) { |
| 164 scoped_refptr<PasswordStore> password_store = | 164 scoped_refptr<PasswordStore> password_store = |
| 165 GetForProfile(profile, ServiceAccessType::EXPLICIT_ACCESS); | 165 GetForProfile(profile, ServiceAccessType::EXPLICIT_ACCESS); |
| 166 if (!password_store) | 166 if (!password_store) |
| 167 return; | 167 return; |
| 168 | 168 |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 break; | 433 break; |
| 434 case LIBSECRET: | 434 case LIBSECRET: |
| 435 usage = OTHER_LIBSECRET; | 435 usage = OTHER_LIBSECRET; |
| 436 break; | 436 break; |
| 437 } | 437 } |
| 438 } | 438 } |
| 439 UMA_HISTOGRAM_ENUMERATION("PasswordManager.LinuxBackendStatistics", usage, | 439 UMA_HISTOGRAM_ENUMERATION("PasswordManager.LinuxBackendStatistics", usage, |
| 440 MAX_BACKEND_USAGE_VALUE); | 440 MAX_BACKEND_USAGE_VALUE); |
| 441 } | 441 } |
| 442 #endif | 442 #endif |
| OLD | NEW |