Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / policy / cloud / policy_header_service_factory.h
blobf81ec939c55a6aba62f0b2bc931ed32410ff7dec
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"
11 namespace policy {
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 {
19 public:
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();
28 protected:
29 // BrowserContextKeyedServiceFactory implementation.
30 KeyedService* BuildServiceInstanceFor(
31 content::BrowserContext* profile) const override;
33 private:
34 friend struct base::DefaultSingletonTraits<PolicyHeaderServiceFactory>;
36 PolicyHeaderServiceFactory();
37 ~PolicyHeaderServiceFactory() override;
39 DISALLOW_COPY_AND_ASSIGN(PolicyHeaderServiceFactory);
42 } // namespace policy
44 #endif // CHROME_BROWSER_POLICY_CLOUD_POLICY_HEADER_SERVICE_FACTORY_H_