1 // Copyright 2013 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_POLICY_CLOUD_POLICY_HEADER_SERVICE_FACTORY_H_
6 #define CHROME_BROWSER_POLICY_CLOUD_POLICY_HEADER_SERVICE_FACTORY_H_
8 #include "base/memory/singleton.h"
9 #include "components/keyed_service/content/browser_context_keyed_service_factory.h"
13 class PolicyHeaderService
;
15 // Factory for PolicyHeaderService objects. PolicyHeaderService is not actually
16 // a KeyedService, so this class wraps PolicyHeaderService in
17 // a KeyedService internally.
18 class PolicyHeaderServiceFactory
: public BrowserContextKeyedServiceFactory
{
20 // Returns the instance of PolicyHeaderService for the passed |context|, or
21 // NULL if there is none (for instance, for incognito windows).
22 static PolicyHeaderService
* GetForBrowserContext(
23 content::BrowserContext
* context
);
25 // Returns an instance of the PolicyHeaderServiceFactory singleton.
26 static PolicyHeaderServiceFactory
* GetInstance();
29 // BrowserContextKeyedServiceFactory implementation.
30 KeyedService
* BuildServiceInstanceFor(
31 content::BrowserContext
* profile
) const override
;
34 friend struct base::DefaultSingletonTraits
<PolicyHeaderServiceFactory
>;
36 PolicyHeaderServiceFactory();
37 ~PolicyHeaderServiceFactory() override
;
39 DISALLOW_COPY_AND_ASSIGN(PolicyHeaderServiceFactory
);
44 #endif // CHROME_BROWSER_POLICY_CLOUD_POLICY_HEADER_SERVICE_FACTORY_H_