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/common/content_switches_internal.h" | 9 #include "content/common/content_switches_internal.h" |
10 #include "content/public/common/content_client.h" | 10 #include "content/public/common/content_client.h" |
11 #include "content/public/renderer/content_renderer_client.h" | 11 #include "content/public/renderer/content_renderer_client.h" |
| 12 #include "content/renderer/pepper/pepper_audio_encoder_host.h" |
12 #include "content/renderer/pepper/pepper_audio_input_host.h" | 13 #include "content/renderer/pepper/pepper_audio_input_host.h" |
13 #include "content/renderer/pepper/pepper_camera_device_host.h" | 14 #include "content/renderer/pepper/pepper_camera_device_host.h" |
14 #include "content/renderer/pepper/pepper_compositor_host.h" | 15 #include "content/renderer/pepper/pepper_compositor_host.h" |
15 #include "content/renderer/pepper/pepper_file_chooser_host.h" | 16 #include "content/renderer/pepper/pepper_file_chooser_host.h" |
16 #include "content/renderer/pepper/pepper_file_ref_renderer_host.h" | 17 #include "content/renderer/pepper/pepper_file_ref_renderer_host.h" |
17 #include "content/renderer/pepper/pepper_file_system_host.h" | 18 #include "content/renderer/pepper/pepper_file_system_host.h" |
18 #include "content/renderer/pepper/pepper_graphics_2d_host.h" | 19 #include "content/renderer/pepper/pepper_graphics_2d_host.h" |
19 #include "content/renderer/pepper/pepper_media_stream_video_track_host.h" | 20 #include "content/renderer/pepper/pepper_media_stream_video_track_host.h" |
20 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 21 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
21 #include "content/renderer/pepper/pepper_url_loader_host.h" | 22 #include "content/renderer/pepper/pepper_url_loader_host.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 if (!host_->IsValidInstance(instance)) | 109 if (!host_->IsValidInstance(instance)) |
109 return scoped_ptr<ResourceHost>(); | 110 return scoped_ptr<ResourceHost>(); |
110 | 111 |
111 PepperPluginInstanceImpl* instance_impl = | 112 PepperPluginInstanceImpl* instance_impl = |
112 host_->GetPluginInstanceImpl(instance); | 113 host_->GetPluginInstanceImpl(instance); |
113 if (!instance_impl->render_frame()) | 114 if (!instance_impl->render_frame()) |
114 return scoped_ptr<ResourceHost>(); | 115 return scoped_ptr<ResourceHost>(); |
115 | 116 |
116 // Public interfaces. | 117 // Public interfaces. |
117 switch (message.type()) { | 118 switch (message.type()) { |
| 119 case PpapiHostMsg_AudioEncoder_Create::ID: |
| 120 return scoped_ptr<ResourceHost>( |
| 121 new PepperAudioEncoderHost(host_, instance, resource)); |
118 case PpapiHostMsg_Compositor_Create::ID: { | 122 case PpapiHostMsg_Compositor_Create::ID: { |
119 if (!CanUseCompositorAPI(host_, instance)) | 123 if (!CanUseCompositorAPI(host_, instance)) |
120 return scoped_ptr<ResourceHost>(); | 124 return scoped_ptr<ResourceHost>(); |
121 return scoped_ptr<ResourceHost>( | 125 return scoped_ptr<ResourceHost>( |
122 new PepperCompositorHost(host_, instance, resource)); | 126 new PepperCompositorHost(host_, instance, resource)); |
123 } | 127 } |
124 case PpapiHostMsg_FileRef_CreateForFileAPI::ID: { | 128 case PpapiHostMsg_FileRef_CreateForFileAPI::ID: { |
125 PP_Resource file_system; | 129 PP_Resource file_system; |
126 std::string internal_path; | 130 std::string internal_path; |
127 if (!UnpackMessage<PpapiHostMsg_FileRef_CreateForFileAPI>( | 131 if (!UnpackMessage<PpapiHostMsg_FileRef_CreateForFileAPI>( |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 | 236 |
233 return scoped_ptr<ResourceHost>(); | 237 return scoped_ptr<ResourceHost>(); |
234 } | 238 } |
235 | 239 |
236 const ppapi::PpapiPermissions& | 240 const ppapi::PpapiPermissions& |
237 ContentRendererPepperHostFactory::GetPermissions() const { | 241 ContentRendererPepperHostFactory::GetPermissions() const { |
238 return host_->GetPpapiHost()->permissions(); | 242 return host_->GetPpapiHost()->permissions(); |
239 } | 243 } |
240 | 244 |
241 } // namespace content | 245 } // namespace content |
OLD | NEW |