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/browser_context_keyed_service/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 DefaultSingletonTraits
<MediaGalleriesPreferencesFactory
>;
29 MediaGalleriesPreferencesFactory();
30 virtual ~MediaGalleriesPreferencesFactory();
32 // BrowserContextKeyedServiceFactory:
33 virtual BrowserContextKeyedService
* BuildServiceInstanceFor(
34 content::BrowserContext
* profile
) const OVERRIDE
;
35 virtual void RegisterProfilePrefs(
36 user_prefs::PrefRegistrySyncable
* registry
) OVERRIDE
;
37 virtual 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_