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

Side by Side Diff: chrome/browser/extensions/chrome_mojo_service_registration.cc

Issue 1177973005: Correct ENABLE_MEDIA_ROUTER defines to fix compilation without it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit fix. Created 5 years, 6 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/extensions/component_extensions_whitelist/whitelist.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 #include "chrome/browser/extensions/chrome_mojo_service_registration.h" 5 #include "chrome/browser/extensions/chrome_mojo_service_registration.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "chrome/common/chrome_switches.h" 10 #include "chrome/common/chrome_switches.h"
11 #include "content/public/browser/render_frame_host.h" 11 #include "content/public/browser/render_frame_host.h"
12 #include "content/public/browser/render_process_host.h" 12 #include "content/public/browser/render_process_host.h"
13 #include "content/public/common/service_registry.h" 13 #include "content/public/common/service_registry.h"
14 #include "extensions/common/extension.h" 14 #include "extensions/common/extension.h"
15 #include "extensions/common/permissions/api_permission.h" 15 #include "extensions/common/permissions/api_permission.h"
16 #include "extensions/common/permissions/permissions_data.h" 16 #include "extensions/common/permissions/permissions_data.h"
17 #include "extensions/common/switches.h" 17 #include "extensions/common/switches.h"
18 18
19 #if defined(ENABLE_MEDIA_ROUTER) 19 #if defined(ENABLE_MEDIA_ROUTER)
20 #include "chrome/browser/media/router/media_router_mojo_impl.h" 20 #include "chrome/browser/media/router/media_router_mojo_impl.h"
21 #endif 21 #endif
22 22
23 namespace extensions { 23 namespace extensions {
24 24
25 void RegisterChromeServicesForFrame(content::RenderFrameHost* render_frame_host, 25 void RegisterChromeServicesForFrame(content::RenderFrameHost* render_frame_host,
26 const Extension* extension) { 26 const Extension* extension) {
27 DCHECK(render_frame_host); 27 DCHECK(render_frame_host);
28 DCHECK(extension); 28 DCHECK(extension);
29 29
30 content::ServiceRegistry* service_registry =
31 render_frame_host->GetServiceRegistry();
32
33 #if defined(ENABLE_MEDIA_ROUTER) 30 #if defined(ENABLE_MEDIA_ROUTER)
34 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 31 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
35 ::switches::kEnableMediaRouter)) { 32 ::switches::kEnableMediaRouter)) {
36 if (extension->permissions_data()->HasAPIPermission( 33 if (extension->permissions_data()->HasAPIPermission(
37 APIPermission::kMediaRouterPrivate)) { 34 APIPermission::kMediaRouterPrivate)) {
38 service_registry->AddService(base::Bind( 35 render_frame_host->GetServiceRegistry()->AddService(base::Bind(
39 media_router::MediaRouterMojoImpl::BindToRequest, extension->id(), 36 media_router::MediaRouterMojoImpl::BindToRequest, extension->id(),
40 render_frame_host->GetProcess()->GetBrowserContext())); 37 render_frame_host->GetProcess()->GetBrowserContext()));
41 } 38 }
42 } 39 }
43 #endif // defined(ENABLE_MEDIA_ROUTER) 40 #endif // defined(ENABLE_MEDIA_ROUTER)
44 } 41 }
45 42
46 } // namespace extensions 43 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/component_extensions_whitelist/whitelist.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698