OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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_TETHER_TETHER_SERVICE_FACTORY_H_ |
| 6 #define CHROME_BROWSER_TETHER_TETHER_SERVICE_FACTORY_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "chrome/browser/tether/tether_service.h" |
| 10 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" |
| 11 |
| 12 namespace content { |
| 13 class BrowserContext; |
| 14 } |
| 15 |
| 16 namespace base { |
| 17 template <typename T> |
| 18 struct DefaultSingletonTraits; |
| 19 } |
| 20 |
| 21 // Singleton factory that builds and owns all TetherServices. |
| 22 class TetherServiceFactory : public BrowserContextKeyedServiceFactory { |
| 23 public: |
| 24 static TetherServiceFactory* GetInstance(); |
| 25 |
| 26 static TetherService* GetForBrowserContext( |
| 27 content::BrowserContext* browser_context); |
| 28 |
| 29 private: |
| 30 friend struct base::DefaultSingletonTraits<TetherServiceFactory>; |
| 31 |
| 32 TetherServiceFactory(); |
| 33 ~TetherServiceFactory() override; |
| 34 |
| 35 // BrowserContextKeyedServiceFactory: |
| 36 KeyedService* BuildServiceInstanceFor( |
| 37 content::BrowserContext* context) const override; |
| 38 void RegisterProfilePrefs( |
| 39 user_prefs::PrefRegistrySyncable* registry) override; |
| 40 |
| 41 DISALLOW_COPY_AND_ASSIGN(TetherServiceFactory); |
| 42 }; |
| 43 |
| 44 #endif // CHROME_BROWSER_TETHER_TETHER_SERVICE_FACTORY_H_ |
OLD | NEW |