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

Side by Side Diff: chrome/browser/media/router/media_router_impl_factory.cc

Issue 1137993005: Remove Media Router impl and BrowserContext factory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | « chrome/browser/media/router/media_router_impl_factory.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/media/router/media_router_impl_factory.h"
6
7 #include "chrome/browser/media/router/media_router_impl.h"
8 #include "components/keyed_service/content/browser_context_dependency_manager.h"
9
10 using content::BrowserContext;
11
12 namespace media_router {
13
14 // static
15 MediaRouterImpl* MediaRouterImplFactory::GetMediaRouterForBrowserContext(
16 BrowserContext* context) {
17 DCHECK(context);
18 return static_cast<MediaRouterImpl*>(
19 GetInstance()->GetServiceForBrowserContext(context, true));
20 }
21
22 // static
23 MediaRouterImplFactory* MediaRouterImplFactory::GetInstance() {
24 return Singleton<MediaRouterImplFactory>::get();
25 }
26
27 MediaRouterImplFactory::MediaRouterImplFactory()
28 : BrowserContextKeyedServiceFactory(
29 "MediaRouterImpl",
30 BrowserContextDependencyManager::GetInstance()) {
31 }
32
33 MediaRouterImplFactory::~MediaRouterImplFactory() {
34 }
35
36 KeyedService* MediaRouterImplFactory::BuildServiceInstanceFor(
37 BrowserContext* context) const {
38 return new MediaRouterImpl;
39 }
40
41 BrowserContext* MediaRouterImplFactory::GetBrowserContextToUse(
42 BrowserContext* context) const {
43 // This means MediaRouterImpl is available in incognito contexts as well.
44 return context;
45 }
46
47 } // namespace media_router
OLDNEW
« no previous file with comments | « chrome/browser/media/router/media_router_impl_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698