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_CONTENT_SETTINGS_COOKIE_SETTINGS_FACTORY_H_
6 #define CHROME_BROWSER_CONTENT_SETTINGS_COOKIE_SETTINGS_FACTORY_H_
10 #include "base/macros.h"
11 #include "base/memory/ref_counted.h"
12 #include "base/memory/singleton.h"
13 #include "components/keyed_service/content/refcounted_browser_context_keyed_service_factory.h"
15 namespace content_settings
{
21 class CookieSettingsFactory
22 : public RefcountedBrowserContextKeyedServiceFactory
{
24 // Returns the |CookieSettings| associated with the |profile|.
26 // This should only be called on the UI thread.
27 static scoped_refptr
<content_settings::CookieSettings
> GetForProfile(
30 static CookieSettingsFactory
* GetInstance();
33 friend struct base::DefaultSingletonTraits
<CookieSettingsFactory
>;
35 CookieSettingsFactory();
36 ~CookieSettingsFactory() override
;
38 // |BrowserContextKeyedBaseFactory| methods:
39 void RegisterProfilePrefs(
40 user_prefs::PrefRegistrySyncable
* registry
) override
;
41 content::BrowserContext
* GetBrowserContextToUse(
42 content::BrowserContext
* context
) const override
;
43 scoped_refptr
<RefcountedKeyedService
> BuildServiceInstanceFor(
44 content::BrowserContext
* context
) const override
;
46 DISALLOW_COPY_AND_ASSIGN(CookieSettingsFactory
);
49 #endif // CHROME_BROWSER_CONTENT_SETTINGS_COOKIE_SETTINGS_FACTORY_H_