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