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_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_FACTORY_H_ |
6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_FACTORY_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_FACTORY_H_ |
7 | 7 |
8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 14 matching lines...) Loading... |
25 static MediaRouter* GetApiForBrowserContext(content::BrowserContext* context); | 25 static MediaRouter* GetApiForBrowserContext(content::BrowserContext* context); |
26 | 26 |
27 static MediaRouterFactory* GetInstance(); | 27 static MediaRouterFactory* GetInstance(); |
28 | 28 |
29 protected: | 29 protected: |
30 // We override the shutdown method for the factory to give the Media Router a | 30 // We override the shutdown method for the factory to give the Media Router a |
31 // chance to remove incognito media routes. | 31 // chance to remove incognito media routes. |
32 void BrowserContextShutdown(content::BrowserContext* context) override; | 32 void BrowserContextShutdown(content::BrowserContext* context) override; |
33 | 33 |
34 private: | 34 private: |
35 friend struct base::DefaultLazyInstanceTraits<MediaRouterFactory>; | 35 friend struct base::LazyInstanceTraitsBase<MediaRouterFactory>; |
36 FRIEND_TEST_ALL_PREFIXES(MediaRouterFactoryTest, | 36 FRIEND_TEST_ALL_PREFIXES(MediaRouterFactoryTest, |
37 IncognitoBrowserContextShutdown); | 37 IncognitoBrowserContextShutdown); |
38 | 38 |
39 MediaRouterFactory(); | 39 MediaRouterFactory(); |
40 ~MediaRouterFactory() override; | 40 ~MediaRouterFactory() override; |
41 | 41 |
42 // BrowserContextKeyedServiceFactory interface. | 42 // BrowserContextKeyedServiceFactory interface. |
43 content::BrowserContext* GetBrowserContextToUse( | 43 content::BrowserContext* GetBrowserContextToUse( |
44 content::BrowserContext* context) const override; | 44 content::BrowserContext* context) const override; |
45 | 45 |
46 KeyedService* BuildServiceInstanceFor( | 46 KeyedService* BuildServiceInstanceFor( |
47 content::BrowserContext* context) const override; | 47 content::BrowserContext* context) const override; |
48 | 48 |
49 DISALLOW_COPY_AND_ASSIGN(MediaRouterFactory); | 49 DISALLOW_COPY_AND_ASSIGN(MediaRouterFactory); |
50 }; | 50 }; |
51 | 51 |
52 } // namespace media_router | 52 } // namespace media_router |
53 | 53 |
54 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_FACTORY_H_ | 54 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_FACTORY_H_ |
OLD | NEW |