OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_MOJO_IMPL_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_FACTORY_H_ |
6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_MOJO_IMPL_FACTORY_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_FACTORY_H_ |
7 | 7 |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" | 9 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" |
10 | 10 |
11 namespace content { | 11 namespace content { |
12 class BrowserContext; | 12 class BrowserContext; |
13 } | 13 } |
14 | 14 |
15 namespace media_router { | 15 namespace media_router { |
16 | 16 |
17 class MediaRouterMojoImpl; | 17 class MediaRouter; |
18 | 18 |
19 // A factory that lazily returns a MediaRouterMojoImpl object for a given | 19 // A factory that lazily returns a MediaRouter implementation for a given |
20 // BrowserContext. | 20 // BrowserContext. |
21 class MediaRouterMojoImplFactory : public BrowserContextKeyedServiceFactory { | 21 class MediaRouterFactory : public BrowserContextKeyedServiceFactory { |
22 public: | 22 public: |
23 static MediaRouterMojoImpl* GetApiForBrowserContext( | 23 static MediaRouter* GetApiForBrowserContext(content::BrowserContext* context); |
24 content::BrowserContext* context); | |
25 | 24 |
26 private: | 25 private: |
27 friend struct base::DefaultLazyInstanceTraits<MediaRouterMojoImplFactory>; | 26 friend struct base::DefaultLazyInstanceTraits<MediaRouterFactory>; |
28 | 27 |
29 MediaRouterMojoImplFactory(); | 28 MediaRouterFactory(); |
30 ~MediaRouterMojoImplFactory() override; | 29 ~MediaRouterFactory() override; |
31 | 30 |
32 // BrowserContextKeyedServiceFactory interface. | 31 // BrowserContextKeyedServiceFactory interface. |
33 KeyedService* BuildServiceInstanceFor( | 32 KeyedService* BuildServiceInstanceFor( |
34 content::BrowserContext* context) const override; | 33 content::BrowserContext* context) const override; |
35 content::BrowserContext* GetBrowserContextToUse( | 34 content::BrowserContext* GetBrowserContextToUse( |
36 content::BrowserContext* context) const override; | 35 content::BrowserContext* context) const override; |
37 | 36 |
38 DISALLOW_COPY_AND_ASSIGN(MediaRouterMojoImplFactory); | 37 DISALLOW_COPY_AND_ASSIGN(MediaRouterFactory); |
39 }; | 38 }; |
40 | 39 |
41 } // namespace media_router | 40 } // namespace media_router |
42 | 41 |
43 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_MOJO_IMPL_FACTORY_H_ | 42 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_FACTORY_H_ |
OLD | NEW |