1 // Copyright 2020 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_THEME_UPDATE_SERVICE_FACTORY_H_
6 #define CHROME_BROWSER_PROFILES_PROFILE_THEME_UPDATE_SERVICE_FACTORY_H_
7 
8 #include "base/no_destructor.h"
9 #include "components/keyed_service/content/browser_context_keyed_service_factory.h"
10 
11 class ProfileThemeUpdateService;
12 class Profile;
13 
14 // Singleton that owns all ProfileThemeUpdateServices and associates them with
15 // Profiles.
16 class ProfileThemeUpdateServiceFactory
17     : public BrowserContextKeyedServiceFactory {
18  public:
19   static ProfileThemeUpdateService* GetForProfile(Profile* profile);
20   static ProfileThemeUpdateServiceFactory* GetInstance();
21 
22   // This class is uncopyable.
23   ProfileThemeUpdateServiceFactory(const ProfileThemeUpdateServiceFactory&) =
24       delete;
25   ProfileThemeUpdateServiceFactory& operator=(
26       const ProfileThemeUpdateServiceFactory&) = delete;
27 
28  private:
29   friend base::NoDestructor<ProfileThemeUpdateServiceFactory>;
30 
31   ProfileThemeUpdateServiceFactory();
32   ~ProfileThemeUpdateServiceFactory() override;
33 
34   // BrowserContextKeyedServiceFactory:
35   KeyedService* BuildServiceInstanceFor(
36       content::BrowserContext* context) const override;
37   bool ServiceIsCreatedWithBrowserContext() const override;
38   bool ServiceIsNULLWhileTesting() const override;
39 };
40 
41 #endif  // CHROME_BROWSER_PROFILES_PROFILE_THEME_UPDATE_SERVICE_FACTORY_H_
42