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

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

Issue 1126923002: Add Media Router Mojo impl code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Redundant forward decl removed. 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
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_mojo_impl_factory.h"
6
7 #include "chrome/browser/media/router/media_router_mojo_impl.h"
8 #include "components/keyed_service/content/browser_context_dependency_manager.h"
9 #include "extensions/browser/process_manager_factory.h"
10
11 using content::BrowserContext;
12
13 namespace media_router {
14
15 // static
16 MediaRouterMojoImpl* MediaRouterMojoImplFactory::GetApiForBrowserContext(
17 BrowserContext* context) {
18 DCHECK(context);
19
20 return static_cast<MediaRouterMojoImpl*>(
21 GetInstance()->GetServiceForBrowserContext(context, true));
22 }
23
24 // static
25 MediaRouterMojoImplFactory* MediaRouterMojoImplFactory::GetInstance() {
26 return Singleton<MediaRouterMojoImplFactory>::get();
Wez 2015/05/20 23:37:49 I'm not familiar with this pattern; is this the pr
imcheng (use chromium acct) 2015/05/21 19:28:52 Done.
27 }
28
29 MediaRouterMojoImplFactory::MediaRouterMojoImplFactory()
30 : BrowserContextKeyedServiceFactory(
31 "MediaRouterMojoImpl",
32 BrowserContextDependencyManager::GetInstance()) {
33 DependsOn(extensions::ProcessManagerFactory::GetInstance());
Wez 2015/05/20 23:37:49 nit: Consider documenting why we depend on this, s
imcheng (use chromium acct) 2015/05/21 19:28:52 Done.
34 }
35
36 MediaRouterMojoImplFactory::~MediaRouterMojoImplFactory() {
37 }
38
39 KeyedService* MediaRouterMojoImplFactory::BuildServiceInstanceFor(
40 BrowserContext* context) const {
41 return new MediaRouterMojoImpl();
42 }
43
44 BrowserContext* MediaRouterMojoImplFactory::GetBrowserContextToUse(
45 BrowserContext* context) const {
46 // This means MediaRouterImpl is available in incongnito contexts as well.
Wez 2015/05/20 23:37:50 typo: Incognito This comment doesn't make clear w
imcheng (use chromium acct) 2015/05/21 19:28:52 I tried to clarified the comment. It just means we
47 return context;
48 }
49
50 } // namespace media_router
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698