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_CHROMEOS_POLICY_USER_NETWORK_CONFIGURATION_UPDATER_FACTORY_H_
6 #define CHROME_BROWSER_CHROMEOS_POLICY_USER_NETWORK_CONFIGURATION_UPDATER_FACTORY_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "components/keyed_service/content/browser_context_keyed_service_factory.h"
14 struct DefaultSingletonTraits
;
20 class UserNetworkConfigurationUpdater
;
22 // Factory to create UserNetworkConfigurationUpdater.
23 class UserNetworkConfigurationUpdaterFactory
24 : public BrowserContextKeyedServiceFactory
{
26 // Returns an existing or creates a new UserNetworkConfigurationUpdater for
27 // |profile|. Will return NULL if this service isn't allowed for |profile|,
28 // i.e. for all but the primary user's profile.
29 static UserNetworkConfigurationUpdater
* GetForProfile(Profile
* profile
);
31 static UserNetworkConfigurationUpdaterFactory
* GetInstance();
34 friend struct base::DefaultSingletonTraits
<
35 UserNetworkConfigurationUpdaterFactory
>;
37 UserNetworkConfigurationUpdaterFactory();
38 ~UserNetworkConfigurationUpdaterFactory() override
;
40 // BrowserContextKeyedServiceFactory:
41 content::BrowserContext
* GetBrowserContextToUse(
42 content::BrowserContext
* context
) const override
;
43 bool ServiceIsCreatedWithBrowserContext() const override
;
44 bool ServiceIsNULLWhileTesting() const override
;
45 KeyedService
* BuildServiceInstanceFor(
46 content::BrowserContext
* context
) const override
;
48 DISALLOW_COPY_AND_ASSIGN(UserNetworkConfigurationUpdaterFactory
);
53 #endif // CHROME_BROWSER_CHROMEOS_POLICY_USER_NETWORK_CONFIGURATION_UPDATER_FACTORY_H_