Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: chrome/browser/media/router/media_router_factory.h

Issue 1916973003: Revert of [Media Router Tests] Add tests for MediaRouterFactory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/media/router/media_router_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
9 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
10 #include "base/macros.h" 9 #include "base/macros.h"
11 #include "components/keyed_service/content/browser_context_keyed_service_factory .h" 10 #include "components/keyed_service/content/browser_context_keyed_service_factory .h"
12 11
13 namespace content { 12 namespace content {
14 class BrowserContext; 13 class BrowserContext;
15 } 14 }
16 15
17 namespace media_router { 16 namespace media_router {
18 17
19 class MediaRouter; 18 class MediaRouter;
20 19
21 // A factory that lazily returns a MediaRouter implementation for a given 20 // A factory that lazily returns a MediaRouter implementation for a given
22 // BrowserContext. 21 // BrowserContext.
23 class MediaRouterFactory : public BrowserContextKeyedServiceFactory { 22 class MediaRouterFactory : public BrowserContextKeyedServiceFactory {
24 public: 23 public:
25 static MediaRouter* GetApiForBrowserContext(content::BrowserContext* context); 24 static MediaRouter* GetApiForBrowserContext(content::BrowserContext* context);
26 25
27 protected: 26 protected:
28 // We override the shutdown method for the factory to give the Media Router a 27 // We override the shutdown method for the factory to give the Media Router a
29 // chance to remove off the record media routes. 28 // chance to remove off the record media routes.
30 void BrowserContextShutdown(content::BrowserContext* context) override; 29 void BrowserContextShutdown(content::BrowserContext* context) override;
31 30
32 private: 31 private:
33 friend struct base::DefaultLazyInstanceTraits<MediaRouterFactory>; 32 friend struct base::DefaultLazyInstanceTraits<MediaRouterFactory>;
34 FRIEND_TEST_ALL_PREFIXES(MediaRouterFactoryTest,
35 OffTheRecordBrowserContextShutdown);
36 33
37 MediaRouterFactory(); 34 MediaRouterFactory();
38 ~MediaRouterFactory() override; 35 ~MediaRouterFactory() override;
39 36
40 // Exposed for testing.
41 static MediaRouterFactory* GetMediaRouterFactoryForTest();
42
43 // BrowserContextKeyedServiceFactory interface. 37 // BrowserContextKeyedServiceFactory interface.
44 content::BrowserContext* GetBrowserContextToUse( 38 content::BrowserContext* GetBrowserContextToUse(
45 content::BrowserContext* context) const override; 39 content::BrowserContext* context) const override;
46 40
47 KeyedService* BuildServiceInstanceFor( 41 KeyedService* BuildServiceInstanceFor(
48 content::BrowserContext* context) const override; 42 content::BrowserContext* context) const override;
49 43
50 DISALLOW_COPY_AND_ASSIGN(MediaRouterFactory); 44 DISALLOW_COPY_AND_ASSIGN(MediaRouterFactory);
51 }; 45 };
52 46
53 } // namespace media_router 47 } // namespace media_router
54 48
55 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_FACTORY_H_ 49 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_FACTORY_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/media/router/media_router_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698