1 // Copyright 2019 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. 4 5 #ifndef CHROME_BROWSER_SYNC_WIFI_CONFIGURATION_SYNC_SERVICE_FACTORY_H_ 6 #define CHROME_BROWSER_SYNC_WIFI_CONFIGURATION_SYNC_SERVICE_FACTORY_H_ 7 8 #include <memory> 9 10 #include "base/macros.h" 11 #include "components/keyed_service/content/browser_context_keyed_service_factory.h" 12 13 class Profile; 14 15 namespace base { 16 template <typename T> 17 struct DefaultSingletonTraits; 18 } // namespace base 19 20 namespace chromeos { 21 namespace sync_wifi { 22 class WifiConfigurationSyncService; 23 } // namespace sync_wifi 24 } // namespace chromeos 25 26 class WifiConfigurationSyncServiceFactory 27 : public BrowserContextKeyedServiceFactory { 28 public: 29 static chromeos::sync_wifi::WifiConfigurationSyncService* GetForProfile( 30 Profile* profile, 31 bool create); 32 static WifiConfigurationSyncServiceFactory* GetInstance(); 33 static bool ShouldRunInProfile(const Profile* profile); 34 35 private: 36 friend struct base::DefaultSingletonTraits< 37 WifiConfigurationSyncServiceFactory>; 38 39 WifiConfigurationSyncServiceFactory(); 40 ~WifiConfigurationSyncServiceFactory() override; 41 42 // BrowserContextKeyedServiceFactory: 43 KeyedService* BuildServiceInstanceFor( 44 content::BrowserContext* context) const override; 45 void RegisterProfilePrefs( 46 user_prefs::PrefRegistrySyncable* registry) override; 47 48 DISALLOW_COPY_AND_ASSIGN(WifiConfigurationSyncServiceFactory); 49 }; 50 51 #endif // CHROME_BROWSER_SYNC_WIFI_CONFIGURATION_SYNC_SERVICE_FACTORY_H_ 52