Index: chrome/browser/password_manager/password_store_factory.cc |
diff --git a/chrome/browser/password_manager/password_store_factory.cc b/chrome/browser/password_manager/password_store_factory.cc |
index 8e6408167eaeec1c4e810fb005223ec6c1acfcfe..13d0e74db4f6cda402aa6ea290e72352f36ce3f5 100644 |
--- a/chrome/browser/password_manager/password_store_factory.cc |
+++ b/chrome/browser/password_manager/password_store_factory.cc |
@@ -193,6 +193,21 @@ void PasswordStoreFactory::OnPasswordsSyncedStatePotentiallyChanged( |
} |
} |
+// static |
+void PasswordStoreFactory::TrimOrDeleteAffiliationCache(Profile* profile) { |
+ scoped_refptr<PasswordStore> password_store = |
+ GetForProfile(profile, ServiceAccessType::EXPLICIT_ACCESS); |
+ if (password_store && password_store->HasAffiliatedMatchHelper()) { |
+ password_store->TrimAffiliationCache(); |
+ } else { |
+ scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner( |
+ content::BrowserThread::GetMessageLoopProxyForThread( |
+ content::BrowserThread::DB)); |
+ password_manager::AffiliationService::DeleteCache( |
+ GetAffiliationDatabasePath(profile), db_thread_runner.get()); |
+ } |
+} |
+ |
PasswordStoreFactory::PasswordStoreFactory() |
: BrowserContextKeyedServiceFactory( |
"PasswordStore", |