Commit 0054df3c authored by Jan Wilken Dörrie's avatar Jan Wilken Dörrie Committed by Commit Bot

[Passwords] PasswordsPrivateDelegate depends on BulkLeakCheckService

Fixed: 1060581
Change-Id: Iba1504630546197dbcd4228a4155feb6f496b3e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2096686
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Auto-Submit: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: default avatarVasilii Sukhanov <vasilii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#749237}
parent 99a5a126
......@@ -6,6 +6,8 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/extensions/api/passwords_private/passwords_private_delegate_impl.h"
#include "chrome/browser/password_manager/bulk_leak_check_service_factory.h"
#include "chrome/browser/password_manager/password_store_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "extensions/browser/extension_system_provider.h"
......@@ -25,17 +27,19 @@ PasswordsPrivateDelegate* PasswordsPrivateDelegateFactory::GetForBrowserContext(
// static
PasswordsPrivateDelegateFactory*
PasswordsPrivateDelegateFactory::GetInstance() {
return base::Singleton<PasswordsPrivateDelegateFactory>::get();
static base::NoDestructor<PasswordsPrivateDelegateFactory> instance;
return instance.get();
}
PasswordsPrivateDelegateFactory::PasswordsPrivateDelegateFactory()
: BrowserContextKeyedServiceFactory(
"PasswordsPrivateDelegate",
BrowserContextDependencyManager::GetInstance()) {
DependsOn(BulkLeakCheckServiceFactory::GetInstance());
DependsOn(PasswordStoreFactory::GetInstance());
}
PasswordsPrivateDelegateFactory::~PasswordsPrivateDelegateFactory() {
}
PasswordsPrivateDelegateFactory::~PasswordsPrivateDelegateFactory() = default;
KeyedService* PasswordsPrivateDelegateFactory::BuildServiceInstanceFor(
content::BrowserContext* profile) const {
......
......@@ -5,8 +5,7 @@
#ifndef CHROME_BROWSER_EXTENSIONS_API_PASSWORDS_PRIVATE_PASSWORDS_PRIVATE_DELEGATE_FACTORY_H_
#define CHROME_BROWSER_EXTENSIONS_API_PASSWORDS_PRIVATE_PASSWORDS_PRIVATE_DELEGATE_FACTORY_H_
#include "base/macros.h"
#include "base/memory/singleton.h"
#include "base/no_destructor.h"
#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
namespace context {
......@@ -27,8 +26,7 @@ class PasswordsPrivateDelegateFactory
static PasswordsPrivateDelegateFactory* GetInstance();
private:
friend struct base::DefaultSingletonTraits<PasswordsPrivateDelegateFactory>;
friend class base::NoDestructor<PasswordsPrivateDelegateFactory>;
PasswordsPrivateDelegateFactory();
~PasswordsPrivateDelegateFactory() override;
......@@ -37,8 +35,6 @@ class PasswordsPrivateDelegateFactory
content::BrowserContext* profile) const override;
bool ServiceIsCreatedWithBrowserContext() const override;
bool ServiceIsNULLWhileTesting() const override;
DISALLOW_COPY_AND_ASSIGN(PasswordsPrivateDelegateFactory);
};
} // namespace extensions
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment