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_OFFSCREEN_PRESENTATION_MANAGER_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_OFFSCREEN_PRESENTATION_MANAGER_FACTORY_H_ |
6 #define CHROME_BROWSER_MEDIA_ROUTER_OFFSCREEN_PRESENTATION_MANAGER_FACTORY_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_OFFSCREEN_PRESENTATION_MANAGER_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 |
(...skipping 13 matching lines...) Expand all Loading... |
24 public: | 24 public: |
25 // If |web_contents| is normal profile, use it as browser context; | 25 // If |web_contents| is normal profile, use it as browser context; |
26 // If |web_contents| is incognito profile, |GetBrowserContextToUse| will | 26 // If |web_contents| is incognito profile, |GetBrowserContextToUse| will |
27 // redirect incognito profile to original profile, and use original one as | 27 // redirect incognito profile to original profile, and use original one as |
28 // browser context. | 28 // browser context. |
29 static OffscreenPresentationManager* GetOrCreateForWebContents( | 29 static OffscreenPresentationManager* GetOrCreateForWebContents( |
30 content::WebContents* web_contents); | 30 content::WebContents* web_contents); |
31 static OffscreenPresentationManager* GetOrCreateForBrowserContext( | 31 static OffscreenPresentationManager* GetOrCreateForBrowserContext( |
32 content::BrowserContext* context); | 32 content::BrowserContext* context); |
33 | 33 |
| 34 // For test use only. |
| 35 static OffscreenPresentationManagerFactory* GetInstanceForTest(); |
| 36 |
34 private: | 37 private: |
35 friend struct base::DefaultLazyInstanceTraits< | 38 friend struct base::DefaultLazyInstanceTraits< |
36 OffscreenPresentationManagerFactory>; | 39 OffscreenPresentationManagerFactory>; |
37 | 40 |
38 OffscreenPresentationManagerFactory(); | 41 OffscreenPresentationManagerFactory(); |
39 ~OffscreenPresentationManagerFactory() override; | 42 ~OffscreenPresentationManagerFactory() override; |
40 | 43 |
41 // BrowserContextKeyedServiceFactory interface. | 44 // BrowserContextKeyedServiceFactory interface. |
42 content::BrowserContext* GetBrowserContextToUse( | 45 content::BrowserContext* GetBrowserContextToUse( |
43 content::BrowserContext* context) const override; | 46 content::BrowserContext* context) const override; |
44 KeyedService* BuildServiceInstanceFor( | 47 KeyedService* BuildServiceInstanceFor( |
45 content::BrowserContext* context) const override; | 48 content::BrowserContext* context) const override; |
46 | 49 |
47 DISALLOW_COPY_AND_ASSIGN(OffscreenPresentationManagerFactory); | 50 DISALLOW_COPY_AND_ASSIGN(OffscreenPresentationManagerFactory); |
48 }; | 51 }; |
49 | 52 |
50 } // namespace media_router | 53 } // namespace media_router |
51 | 54 |
52 #endif // CHROME_BROWSER_MEDIA_ROUTER_OFFSCREEN_PRESENTATION_MANAGER_FACTORY_H_ | 55 #endif // CHROME_BROWSER_MEDIA_ROUTER_OFFSCREEN_PRESENTATION_MANAGER_FACTORY_H_ |
OLD | NEW |