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_destination_host.h" | 22 #include "content/renderer/pepper/pepper_video_destination_host.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 if (!host_->IsValidInstance(instance)) | 75 if (!host_->IsValidInstance(instance)) |
75 return scoped_ptr<ResourceHost>(); | 76 return scoped_ptr<ResourceHost>(); |
76 | 77 |
77 PepperPluginInstanceImpl* instance_impl = | 78 PepperPluginInstanceImpl* instance_impl = |
78 host_->GetPluginInstanceImpl(instance); | 79 host_->GetPluginInstanceImpl(instance); |
79 if (!instance_impl->render_frame()) | 80 if (!instance_impl->render_frame()) |
80 return scoped_ptr<ResourceHost>(); | 81 return scoped_ptr<ResourceHost>(); |
81 | 82 |
82 // Public interfaces. | 83 // Public interfaces. |
83 switch (message.type()) { | 84 switch (message.type()) { |
| 85 case PpapiHostMsg_Compositor_Create::ID: { |
| 86 return scoped_ptr<ResourceHost>( |
| 87 new PepperCompositorHost(host_, instance, params.pp_resource())); |
| 88 } |
84 case PpapiHostMsg_FileRef_CreateForFileAPI::ID: { | 89 case PpapiHostMsg_FileRef_CreateForFileAPI::ID: { |
85 PP_Resource file_system; | 90 PP_Resource file_system; |
86 std::string internal_path; | 91 std::string internal_path; |
87 if (!UnpackMessage<PpapiHostMsg_FileRef_CreateForFileAPI>( | 92 if (!UnpackMessage<PpapiHostMsg_FileRef_CreateForFileAPI>( |
88 message, &file_system, &internal_path)) { | 93 message, &file_system, &internal_path)) { |
89 NOTREACHED(); | 94 NOTREACHED(); |
90 return scoped_ptr<ResourceHost>(); | 95 return scoped_ptr<ResourceHost>(); |
91 } | 96 } |
92 return scoped_ptr<ResourceHost>(new PepperFileRefRendererHost( | 97 return scoped_ptr<ResourceHost>(new PepperFileRefRendererHost( |
93 host_, instance, params.pp_resource(), file_system, internal_path)); | 98 host_, instance, params.pp_resource(), file_system, internal_path)); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 | 186 |
182 return scoped_ptr<ResourceHost>(); | 187 return scoped_ptr<ResourceHost>(); |
183 } | 188 } |
184 | 189 |
185 const ppapi::PpapiPermissions& | 190 const ppapi::PpapiPermissions& |
186 ContentRendererPepperHostFactory::GetPermissions() const { | 191 ContentRendererPepperHostFactory::GetPermissions() const { |
187 return host_->GetPpapiHost()->permissions(); | 192 return host_->GetPpapiHost()->permissions(); |
188 } | 193 } |
189 | 194 |
190 } // namespace content | 195 } // namespace content |
OLD | NEW |