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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_PREFERENCES_FACTORY_H_
6 #define CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_PREFERENCES_FACTORY_H_
8 #include "base/basictypes.h"
9 #include "base/memory/singleton.h"
10 #include "components/keyed_service/content/browser_context_keyed_service_factory.h"
12 class MediaGalleriesPreferences
;
15 // Singleton that owns all MediaGalleriesPreferences and associates them with
17 class MediaGalleriesPreferencesFactory
18 : public BrowserContextKeyedServiceFactory
{
20 // Use MediaFileSystemRegistry::GetPreferences() to get
21 // MediaGalleriesPreferences.
22 static MediaGalleriesPreferences
* GetForProfile(Profile
* profile
);
24 static MediaGalleriesPreferencesFactory
* GetInstance();
27 friend struct base::DefaultSingletonTraits
<MediaGalleriesPreferencesFactory
>;
29 MediaGalleriesPreferencesFactory();
30 ~MediaGalleriesPreferencesFactory() override
;
32 // BrowserContextKeyedServiceFactory:
33 KeyedService
* BuildServiceInstanceFor(
34 content::BrowserContext
* profile
) const override
;
35 void RegisterProfilePrefs(
36 user_prefs::PrefRegistrySyncable
* registry
) override
;
37 content::BrowserContext
* GetBrowserContextToUse(
38 content::BrowserContext
* context
) const override
;
40 DISALLOW_COPY_AND_ASSIGN(MediaGalleriesPreferencesFactory
);
43 #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_PREFERENCES_FACTORY_H_