| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_USER_CLOUD_POLICY_TOKEN_FORWARDER_FACTORY
_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_USER_CLOUD_POLICY_TOKEN_FORWARDER_FACTORY
_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_POLICY_USER_CLOUD_POLICY_TOKEN_FORWARDER_FACTORY
_H_ | 6 #define CHROME_BROWSER_CHROMEOS_POLICY_USER_CLOUD_POLICY_TOKEN_FORWARDER_FACTORY
_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
| 10 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" | 10 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 class BrowserContext; | 13 class BrowserContext; |
| 14 } | 14 } |
| 15 | 15 |
| 16 namespace policy { | 16 namespace policy { |
| 17 | 17 |
| 18 // Creates instances of UserCloudPolicyTokenForwarder for Profiles that may need | 18 // Creates instances of UserCloudPolicyTokenForwarder for Profiles that may need |
| 19 // to fetch the policy token. | 19 // to fetch the policy token. |
| 20 class UserCloudPolicyTokenForwarderFactory | 20 class UserCloudPolicyTokenForwarderFactory |
| 21 : public BrowserContextKeyedServiceFactory { | 21 : public BrowserContextKeyedServiceFactory { |
| 22 public: | 22 public: |
| 23 // Returns an instance of the UserCloudPolicyTokenForwarderFactory singleton. | 23 // Returns an instance of the UserCloudPolicyTokenForwarderFactory singleton. |
| 24 static UserCloudPolicyTokenForwarderFactory* GetInstance(); | 24 static UserCloudPolicyTokenForwarderFactory* GetInstance(); |
| 25 | 25 |
| 26 private: | 26 private: |
| 27 friend struct DefaultSingletonTraits<UserCloudPolicyTokenForwarderFactory>; | 27 friend struct base::DefaultSingletonTraits< |
| 28 UserCloudPolicyTokenForwarderFactory>; |
| 28 | 29 |
| 29 UserCloudPolicyTokenForwarderFactory(); | 30 UserCloudPolicyTokenForwarderFactory(); |
| 30 ~UserCloudPolicyTokenForwarderFactory() override; | 31 ~UserCloudPolicyTokenForwarderFactory() override; |
| 31 | 32 |
| 32 // BrowserContextKeyedServiceFactory: | 33 // BrowserContextKeyedServiceFactory: |
| 33 KeyedService* BuildServiceInstanceFor( | 34 KeyedService* BuildServiceInstanceFor( |
| 34 content::BrowserContext* context) const override; | 35 content::BrowserContext* context) const override; |
| 35 bool ServiceIsCreatedWithBrowserContext() const override; | 36 bool ServiceIsCreatedWithBrowserContext() const override; |
| 36 bool ServiceIsNULLWhileTesting() const override; | 37 bool ServiceIsNULLWhileTesting() const override; |
| 37 | 38 |
| 38 DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyTokenForwarderFactory); | 39 DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyTokenForwarderFactory); |
| 39 }; | 40 }; |
| 40 | 41 |
| 41 } // namespace policy | 42 } // namespace policy |
| 42 | 43 |
| 43 #endif // CHROME_BROWSER_CHROMEOS_POLICY_USER_CLOUD_POLICY_TOKEN_FORWARDER_FACT
ORY_H_ | 44 #endif // CHROME_BROWSER_CHROMEOS_POLICY_USER_CLOUD_POLICY_TOKEN_FORWARDER_FACT
ORY_H_ |
| OLD | NEW |