OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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_NETWORK_CONFIGURATION_UPDATER_FACTOR
Y_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_USER_NETWORK_CONFIGURATION_UPDATER_FACTOR
Y_H_ |
6 #define CHROME_BROWSER_CHROMEOS_POLICY_USER_NETWORK_CONFIGURATION_UPDATER_FACTOR
Y_H_ | 6 #define CHROME_BROWSER_CHROMEOS_POLICY_USER_NETWORK_CONFIGURATION_UPDATER_FACTOR
Y_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.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 template <typename T> | 12 template <typename T> |
13 struct DefaultSingletonTraits; | 13 struct base::DefaultSingletonTraits; |
14 | 14 |
15 class Profile; | 15 class Profile; |
16 | 16 |
17 namespace policy { | 17 namespace policy { |
18 | 18 |
19 class UserNetworkConfigurationUpdater; | 19 class UserNetworkConfigurationUpdater; |
20 | 20 |
21 // Factory to create UserNetworkConfigurationUpdater. | 21 // Factory to create UserNetworkConfigurationUpdater. |
22 class UserNetworkConfigurationUpdaterFactory | 22 class UserNetworkConfigurationUpdaterFactory |
23 : public BrowserContextKeyedServiceFactory { | 23 : public BrowserContextKeyedServiceFactory { |
24 public: | 24 public: |
25 // Returns an existing or creates a new UserNetworkConfigurationUpdater for | 25 // Returns an existing or creates a new UserNetworkConfigurationUpdater for |
26 // |profile|. Will return NULL if this service isn't allowed for |profile|, | 26 // |profile|. Will return NULL if this service isn't allowed for |profile|, |
27 // i.e. for all but the primary user's profile. | 27 // i.e. for all but the primary user's profile. |
28 static UserNetworkConfigurationUpdater* GetForProfile(Profile* profile); | 28 static UserNetworkConfigurationUpdater* GetForProfile(Profile* profile); |
29 | 29 |
30 static UserNetworkConfigurationUpdaterFactory* GetInstance(); | 30 static UserNetworkConfigurationUpdaterFactory* GetInstance(); |
31 | 31 |
32 private: | 32 private: |
33 friend struct DefaultSingletonTraits<UserNetworkConfigurationUpdaterFactory>; | 33 friend struct base::DefaultSingletonTraits< |
| 34 UserNetworkConfigurationUpdaterFactory>; |
34 | 35 |
35 UserNetworkConfigurationUpdaterFactory(); | 36 UserNetworkConfigurationUpdaterFactory(); |
36 ~UserNetworkConfigurationUpdaterFactory() override; | 37 ~UserNetworkConfigurationUpdaterFactory() override; |
37 | 38 |
38 // BrowserContextKeyedServiceFactory: | 39 // BrowserContextKeyedServiceFactory: |
39 content::BrowserContext* GetBrowserContextToUse( | 40 content::BrowserContext* GetBrowserContextToUse( |
40 content::BrowserContext* context) const override; | 41 content::BrowserContext* context) const override; |
41 bool ServiceIsCreatedWithBrowserContext() const override; | 42 bool ServiceIsCreatedWithBrowserContext() const override; |
42 bool ServiceIsNULLWhileTesting() const override; | 43 bool ServiceIsNULLWhileTesting() const override; |
43 KeyedService* BuildServiceInstanceFor( | 44 KeyedService* BuildServiceInstanceFor( |
44 content::BrowserContext* context) const override; | 45 content::BrowserContext* context) const override; |
45 | 46 |
46 DISALLOW_COPY_AND_ASSIGN(UserNetworkConfigurationUpdaterFactory); | 47 DISALLOW_COPY_AND_ASSIGN(UserNetworkConfigurationUpdaterFactory); |
47 }; | 48 }; |
48 | 49 |
49 } // namespace policy | 50 } // namespace policy |
50 | 51 |
51 #endif // CHROME_BROWSER_CHROMEOS_POLICY_USER_NETWORK_CONFIGURATION_UPDATER_FAC
TORY_H_ | 52 #endif // CHROME_BROWSER_CHROMEOS_POLICY_USER_NETWORK_CONFIGURATION_UPDATER_FAC
TORY_H_ |
OLD | NEW |