diff options
Diffstat (limited to 'chromium/chrome/browser/signin/signin_profile_attributes_updater_factory.h')
-rw-r--r-- | chromium/chrome/browser/signin/signin_profile_attributes_updater_factory.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/chromium/chrome/browser/signin/signin_profile_attributes_updater_factory.h b/chromium/chrome/browser/signin/signin_profile_attributes_updater_factory.h new file mode 100644 index 00000000000..78f990abaf8 --- /dev/null +++ b/chromium/chrome/browser/signin/signin_profile_attributes_updater_factory.h @@ -0,0 +1,42 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_SIGNIN_SIGNIN_PROFILE_ATTRIBUTES_UPDATER_FACTORY_H_ +#define CHROME_BROWSER_SIGNIN_SIGNIN_PROFILE_ATTRIBUTES_UPDATER_FACTORY_H_ + +#include "base/memory/singleton.h" +#include "components/keyed_service/content/browser_context_keyed_service_factory.h" + +class Profile; +class SigninProfileAttributesUpdater; + +class SigninProfileAttributesUpdaterFactory + : public BrowserContextKeyedServiceFactory { + public: + // Returns nullptr if this profile cannot have a + // SigninProfileAttributesUpdater (for example, if |profile| is incognito). + static SigninProfileAttributesUpdater* GetForProfile(Profile* profile); + + // Returns an instance of the factory singleton. + static SigninProfileAttributesUpdaterFactory* GetInstance(); + + SigninProfileAttributesUpdaterFactory( + const SigninProfileAttributesUpdaterFactory&) = delete; + SigninProfileAttributesUpdaterFactory& operator=( + const SigninProfileAttributesUpdaterFactory&) = delete; + + private: + friend struct base::DefaultSingletonTraits< + SigninProfileAttributesUpdaterFactory>; + + SigninProfileAttributesUpdaterFactory(); + ~SigninProfileAttributesUpdaterFactory() override; + + // BrowserContextKeyedServiceFactory: + KeyedService* BuildServiceInstanceFor( + content::BrowserContext* profile) const override; + bool ServiceIsCreatedWithBrowserContext() const override; +}; + +#endif // CHROME_BROWSER_SIGNIN_SIGNIN_PROFILE_ATTRIBUTES_UPDATER_FACTORY_H_ |