Chromium Code Reviews| 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_MEDIA_ROUTER_DISCOVERY_DIAL_DIAL_REGISTRY_FACTORY_H_ | |
| 6 #define CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_DIAL_DIAL_REGISTRY_FACTORY_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "base/memory/singleton.h" | |
| 10 #include "components/keyed_service/content/refcounted_browser_context_keyed_serv ice_factory.h" | |
| 11 | |
| 12 namespace content { | |
| 13 class BrowserContext; | |
| 14 } | |
| 15 | |
| 16 namespace media_router { | |
| 17 | |
| 18 class DialRegistry; | |
| 19 | |
| 20 // A factory that lazily returns a DialRegistry implementation for a given | |
| 21 // BrowserContext. | |
| 22 class DialRegistryFactory : public RefcountedBrowserContextKeyedServiceFactory { | |
| 23 public: | |
| 24 static scoped_refptr<DialRegistry> GetForBrowserContext( | |
|
mark a. foltz
2017/03/18 18:04:58
If DialRegistry is not profile-keyed, this could j
zhaobin
2017/03/22 02:48:45
Done.
| |
| 25 content::BrowserContext* context); | |
| 26 | |
| 27 static DialRegistryFactory* GetInstance(); | |
| 28 | |
| 29 private: | |
| 30 friend struct base::DefaultSingletonTraits<DialRegistryFactory>; | |
| 31 | |
| 32 DialRegistryFactory(); | |
| 33 ~DialRegistryFactory() override; | |
| 34 | |
| 35 // BrowserContextKeyedServiceFactory interface. | |
| 36 content::BrowserContext* GetBrowserContextToUse( | |
| 37 content::BrowserContext* context) const override; | |
| 38 | |
| 39 scoped_refptr<RefcountedKeyedService> BuildServiceInstanceFor( | |
| 40 content::BrowserContext* context) const override; | |
| 41 | |
| 42 DISALLOW_COPY_AND_ASSIGN(DialRegistryFactory); | |
| 43 }; | |
| 44 | |
| 45 } // namespace media_router | |
| 46 | |
| 47 #endif // CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_DIAL_DIAL_REGISTRY_FACTORY_H_ | |
| OLD | NEW |