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" |
11 #include "content/renderer/pepper/pepper_audio_input_host.h" | 11 #include "content/renderer/pepper/pepper_audio_input_host.h" |
| 12 #include "content/renderer/pepper/pepper_compositor_host.h" |
12 #include "content/renderer/pepper/pepper_file_chooser_host.h" | 13 #include "content/renderer/pepper/pepper_file_chooser_host.h" |
13 #include "content/renderer/pepper/pepper_file_ref_renderer_host.h" | 14 #include "content/renderer/pepper/pepper_file_ref_renderer_host.h" |
14 #include "content/renderer/pepper/pepper_file_system_host.h" | 15 #include "content/renderer/pepper/pepper_file_system_host.h" |
15 #include "content/renderer/pepper/pepper_graphics_2d_host.h" | 16 #include "content/renderer/pepper/pepper_graphics_2d_host.h" |
16 #include "content/renderer/pepper/pepper_media_stream_video_track_host.h" | 17 #include "content/renderer/pepper/pepper_media_stream_video_track_host.h" |
17 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 18 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
18 #include "content/renderer/pepper/pepper_truetype_font_host.h" | 19 #include "content/renderer/pepper/pepper_truetype_font_host.h" |
19 #include "content/renderer/pepper/pepper_url_loader_host.h" | 20 #include "content/renderer/pepper/pepper_url_loader_host.h" |
20 #include "content/renderer/pepper/pepper_video_capture_host.h" | 21 #include "content/renderer/pepper/pepper_video_capture_host.h" |
21 #include "content/renderer/pepper/pepper_video_decoder_host.h" | 22 #include "content/renderer/pepper/pepper_video_decoder_host.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 if (!host_->IsValidInstance(instance)) | 76 if (!host_->IsValidInstance(instance)) |
76 return scoped_ptr<ResourceHost>(); | 77 return scoped_ptr<ResourceHost>(); |
77 | 78 |
78 PepperPluginInstanceImpl* instance_impl = | 79 PepperPluginInstanceImpl* instance_impl = |
79 host_->GetPluginInstanceImpl(instance); | 80 host_->GetPluginInstanceImpl(instance); |
80 if (!instance_impl->render_frame()) | 81 if (!instance_impl->render_frame()) |
81 return scoped_ptr<ResourceHost>(); | 82 return scoped_ptr<ResourceHost>(); |
82 | 83 |
83 // Public interfaces. | 84 // Public interfaces. |
84 switch (message.type()) { | 85 switch (message.type()) { |
| 86 case PpapiHostMsg_Compositor_Create::ID: { |
| 87 return scoped_ptr<ResourceHost>( |
| 88 new PepperCompositorHost(host_, instance, params.pp_resource())); |
| 89 } |
85 case PpapiHostMsg_FileRef_CreateForFileAPI::ID: { | 90 case PpapiHostMsg_FileRef_CreateForFileAPI::ID: { |
86 PP_Resource file_system; | 91 PP_Resource file_system; |
87 std::string internal_path; | 92 std::string internal_path; |
88 if (!UnpackMessage<PpapiHostMsg_FileRef_CreateForFileAPI>( | 93 if (!UnpackMessage<PpapiHostMsg_FileRef_CreateForFileAPI>( |
89 message, &file_system, &internal_path)) { | 94 message, &file_system, &internal_path)) { |
90 NOTREACHED(); | 95 NOTREACHED(); |
91 return scoped_ptr<ResourceHost>(); | 96 return scoped_ptr<ResourceHost>(); |
92 } | 97 } |
93 return scoped_ptr<ResourceHost>(new PepperFileRefRendererHost( | 98 return scoped_ptr<ResourceHost>(new PepperFileRefRendererHost( |
94 host_, instance, params.pp_resource(), file_system, internal_path)); | 99 host_, instance, params.pp_resource(), file_system, internal_path)); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 | 190 |
186 return scoped_ptr<ResourceHost>(); | 191 return scoped_ptr<ResourceHost>(); |
187 } | 192 } |
188 | 193 |
189 const ppapi::PpapiPermissions& | 194 const ppapi::PpapiPermissions& |
190 ContentRendererPepperHostFactory::GetPermissions() const { | 195 ContentRendererPepperHostFactory::GetPermissions() const { |
191 return host_->GetPpapiHost()->permissions(); | 196 return host_->GetPpapiHost()->permissions(); |
192 } | 197 } |
193 | 198 |
194 } // namespace content | 199 } // namespace content |
OLD | NEW |