Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: chrome/browser/password_manager/password_store_factory.cc

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT ios Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 PasswordStoreFactory* factory = GetInstance(); 164 PasswordStoreFactory* factory = GetInstance();
165 PasswordStoreService* service = static_cast<PasswordStoreService*>( 165 PasswordStoreService* service = static_cast<PasswordStoreService*>(
166 factory->GetServiceForBrowserContext(profile, true)); 166 factory->GetServiceForBrowserContext(profile, true));
167 if (!service) 167 if (!service)
168 return nullptr; 168 return nullptr;
169 return service->GetPasswordStore(); 169 return service->GetPasswordStore();
170 } 170 }
171 171
172 // static 172 // static
173 PasswordStoreFactory* PasswordStoreFactory::GetInstance() { 173 PasswordStoreFactory* PasswordStoreFactory::GetInstance() {
174 return Singleton<PasswordStoreFactory>::get(); 174 return base::Singleton<PasswordStoreFactory>::get();
175 } 175 }
176 176
177 // static 177 // static
178 void PasswordStoreFactory::OnPasswordsSyncedStatePotentiallyChanged( 178 void PasswordStoreFactory::OnPasswordsSyncedStatePotentiallyChanged(
179 Profile* profile) { 179 Profile* profile) {
180 scoped_refptr<PasswordStore> password_store = 180 scoped_refptr<PasswordStore> password_store =
181 GetForProfile(profile, ServiceAccessType::EXPLICIT_ACCESS); 181 GetForProfile(profile, ServiceAccessType::EXPLICIT_ACCESS);
182 if (!password_store) 182 if (!password_store)
183 return; 183 return;
184 184
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 break; 447 break;
448 case LIBSECRET: 448 case LIBSECRET:
449 usage = OTHER_LIBSECRET; 449 usage = OTHER_LIBSECRET;
450 break; 450 break;
451 } 451 }
452 } 452 }
453 UMA_HISTOGRAM_ENUMERATION("PasswordManager.LinuxBackendStatistics", usage, 453 UMA_HISTOGRAM_ENUMERATION("PasswordManager.LinuxBackendStatistics", usage,
454 MAX_BACKEND_USAGE_VALUE); 454 MAX_BACKEND_USAGE_VALUE);
455 } 455 }
456 #endif 456 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698