| 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 #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/logging.h" | 8 #include "base/logging.h" |
| 9 #include "content/public/browser/render_frame_host.h" | 9 #include "content/public/browser/render_frame_host.h" |
| 10 #include "content/public/browser/render_process_host.h" | 10 #include "content/public/browser/render_process_host.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 DCHECK(extension); | 26 DCHECK(extension); |
| 27 | 27 |
| 28 #if defined(ENABLE_MEDIA_ROUTER) | 28 #if defined(ENABLE_MEDIA_ROUTER) |
| 29 content::BrowserContext* context = | 29 content::BrowserContext* context = |
| 30 render_frame_host->GetProcess()->GetBrowserContext(); | 30 render_frame_host->GetProcess()->GetBrowserContext(); |
| 31 if (media_router::MediaRouterEnabled(context)) { | 31 if (media_router::MediaRouterEnabled(context)) { |
| 32 if (extension->permissions_data()->HasAPIPermission( | 32 if (extension->permissions_data()->HasAPIPermission( |
| 33 APIPermission::kMediaRouterPrivate)) { | 33 APIPermission::kMediaRouterPrivate)) { |
| 34 render_frame_host->GetServiceRegistry()->AddService( | 34 render_frame_host->GetServiceRegistry()->AddService( |
| 35 base::Bind(media_router::MediaRouterMojoImpl::BindToRequest, | 35 base::Bind(media_router::MediaRouterMojoImpl::BindToRequest, |
| 36 extension->id(), context)); | 36 extension, context)); |
| 37 } | 37 } |
| 38 } | 38 } |
| 39 #endif // defined(ENABLE_MEDIA_ROUTER) | 39 #endif // defined(ENABLE_MEDIA_ROUTER) |
| 40 } | 40 } |
| 41 | 41 |
| 42 } // namespace extensions | 42 } // namespace extensions |
| OLD | NEW |