| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/renderer/pepper/content_renderer_pepper_host_factory.h" | 5 #include "content/renderer/pepper/content_renderer_pepper_host_factory.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "content/public/common/content_client.h" | 9 #include "content/public/common/content_client.h" |
| 10 #include "content/public/renderer/content_renderer_client.h" | 10 #include "content/public/renderer/content_renderer_client.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 return scoped_ptr<ResourceHost>(new PepperWebSocketHost( | 122 return scoped_ptr<ResourceHost>(new PepperWebSocketHost( |
| 123 host_, instance, params.pp_resource())); | 123 host_, instance, params.pp_resource())); |
| 124 #if defined(ENABLE_WEBRTC) | 124 #if defined(ENABLE_WEBRTC) |
| 125 // These private MediaStream interfaces are exposed as if they were public | 125 // These private MediaStream interfaces are exposed as if they were public |
| 126 // so they can be used by NaCl plugins. However, they are available only | 126 // so they can be used by NaCl plugins. However, they are available only |
| 127 // for whitelisted apps. | 127 // for whitelisted apps. |
| 128 case PpapiHostMsg_VideoDestination_Create::ID: | 128 case PpapiHostMsg_VideoDestination_Create::ID: |
| 129 if (CanUseMediaStreamAPI(host_, instance)) | 129 if (CanUseMediaStreamAPI(host_, instance)) |
| 130 return scoped_ptr<ResourceHost>(new PepperVideoDestinationHost( | 130 return scoped_ptr<ResourceHost>(new PepperVideoDestinationHost( |
| 131 host_, instance, params.pp_resource())); | 131 host_, instance, params.pp_resource())); |
| 132 break; |
| 132 case PpapiHostMsg_VideoSource_Create::ID: | 133 case PpapiHostMsg_VideoSource_Create::ID: |
| 133 if (CanUseMediaStreamAPI(host_, instance)) | 134 if (CanUseMediaStreamAPI(host_, instance)) |
| 134 return scoped_ptr<ResourceHost>(new PepperVideoSourceHost( | 135 return scoped_ptr<ResourceHost>(new PepperVideoSourceHost( |
| 135 host_, instance, params.pp_resource())); | 136 host_, instance, params.pp_resource())); |
| 136 #endif // defined(ENABLE_WEBRTC) | 137 #endif // defined(ENABLE_WEBRTC) |
| 137 } | 138 } |
| 138 | 139 |
| 139 // Dev interfaces. | 140 // Dev interfaces. |
| 140 if (GetPermissions().HasPermission(ppapi::PERMISSION_DEV)) { | 141 if (GetPermissions().HasPermission(ppapi::PERMISSION_DEV)) { |
| 141 switch (message.type()) { | 142 switch (message.type()) { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 | 175 |
| 175 return scoped_ptr<ResourceHost>(); | 176 return scoped_ptr<ResourceHost>(); |
| 176 } | 177 } |
| 177 | 178 |
| 178 const ppapi::PpapiPermissions& | 179 const ppapi::PpapiPermissions& |
| 179 ContentRendererPepperHostFactory::GetPermissions() const { | 180 ContentRendererPepperHostFactory::GetPermissions() const { |
| 180 return host_->GetPpapiHost()->permissions(); | 181 return host_->GetPpapiHost()->permissions(); |
| 181 } | 182 } |
| 182 | 183 |
| 183 } // namespace content | 184 } // namespace content |
| OLD | NEW |