Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / chromeos / policy / user_network_configuration_updater_factory.h
blobd91dcab6f8a9392b6c048378b73ac9adfb0ec97e
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"
12 namespace base {
13 template <typename T>
14 struct DefaultSingletonTraits;
15 } // namespace base
16 class Profile;
18 namespace policy {
20 class UserNetworkConfigurationUpdater;
22 // Factory to create UserNetworkConfigurationUpdater.
23 class UserNetworkConfigurationUpdaterFactory
24 : public BrowserContextKeyedServiceFactory {
25 public:
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();
33 private:
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);
51 } // namespace policy
53 #endif // CHROME_BROWSER_CHROMEOS_POLICY_USER_NETWORK_CONFIGURATION_UPDATER_FACTORY_H_