| 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/pepper_in_process_resource_creation.h" | 5 #include "content/renderer/pepper/pepper_in_process_resource_creation.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| 11 #include "content/child/browser_font_resource_trusted.h" |
| 11 #include "content/renderer/pepper/pepper_in_process_router.h" | 12 #include "content/renderer/pepper/pepper_in_process_router.h" |
| 12 #include "content/renderer/pepper/ppapi_plugin_instance_impl.h" | 13 #include "content/renderer/pepper/ppapi_plugin_instance_impl.h" |
| 13 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" | 14 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" |
| 14 #include "content/renderer/render_view_impl.h" | 15 #include "content/renderer/render_view_impl.h" |
| 15 #include "ipc/ipc_message.h" | 16 #include "ipc/ipc_message.h" |
| 16 #include "ipc/ipc_message_macros.h" | 17 #include "ipc/ipc_message_macros.h" |
| 17 #include "ppapi/host/ppapi_host.h" | 18 #include "ppapi/host/ppapi_host.h" |
| 18 #include "ppapi/proxy/browser_font_resource_trusted.h" | |
| 19 #include "ppapi/proxy/ext_crx_file_system_private_resource.h" | 19 #include "ppapi/proxy/ext_crx_file_system_private_resource.h" |
| 20 #include "ppapi/proxy/file_chooser_resource.h" | 20 #include "ppapi/proxy/file_chooser_resource.h" |
| 21 #include "ppapi/proxy/file_io_resource.h" | 21 #include "ppapi/proxy/file_io_resource.h" |
| 22 #include "ppapi/proxy/file_system_resource.h" | 22 #include "ppapi/proxy/file_system_resource.h" |
| 23 #include "ppapi/proxy/graphics_2d_resource.h" | 23 #include "ppapi/proxy/graphics_2d_resource.h" |
| 24 #include "ppapi/proxy/ppapi_messages.h" | 24 #include "ppapi/proxy/ppapi_messages.h" |
| 25 #include "ppapi/proxy/printing_resource.h" | 25 #include "ppapi/proxy/printing_resource.h" |
| 26 #include "ppapi/proxy/url_loader_resource.h" | 26 #include "ppapi/proxy/url_loader_resource.h" |
| 27 #include "ppapi/proxy/url_request_info_resource.h" | 27 #include "ppapi/proxy/url_request_info_resource.h" |
| 28 #include "ppapi/proxy/url_response_info_resource.h" | 28 #include "ppapi/proxy/url_response_info_resource.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 46 : ResourceCreationImpl(instance), | 46 : ResourceCreationImpl(instance), |
| 47 host_impl_(host_impl) { | 47 host_impl_(host_impl) { |
| 48 } | 48 } |
| 49 | 49 |
| 50 PepperInProcessResourceCreation::~PepperInProcessResourceCreation() { | 50 PepperInProcessResourceCreation::~PepperInProcessResourceCreation() { |
| 51 } | 51 } |
| 52 | 52 |
| 53 PP_Resource PepperInProcessResourceCreation::CreateBrowserFont( | 53 PP_Resource PepperInProcessResourceCreation::CreateBrowserFont( |
| 54 PP_Instance instance, | 54 PP_Instance instance, |
| 55 const PP_BrowserFont_Trusted_Description* description) { | 55 const PP_BrowserFont_Trusted_Description* description) { |
| 56 if (!ppapi::proxy::BrowserFontResource_Trusted::IsPPFontDescriptionValid( | 56 if (!BrowserFontResource_Trusted::IsPPFontDescriptionValid(*description)) |
| 57 *description)) | |
| 58 return 0; | 57 return 0; |
| 59 ppapi::Preferences prefs( | 58 ppapi::Preferences prefs( |
| 60 host_impl_->GetRenderViewForInstance(instance)->GetWebkitPreferences()); | 59 host_impl_->GetRenderViewForInstance(instance)->GetWebkitPreferences()); |
| 61 return (new ppapi::proxy::BrowserFontResource_Trusted( | 60 return (new BrowserFontResource_Trusted( |
| 62 host_impl_->in_process_router()->GetPluginConnection(instance), | 61 host_impl_->in_process_router()->GetPluginConnection(instance), |
| 63 instance, | 62 instance, |
| 64 *description, | 63 *description, |
| 65 prefs))->GetReference(); | 64 prefs))->GetReference(); |
| 66 } | 65 } |
| 67 | 66 |
| 68 PP_Resource PepperInProcessResourceCreation::CreateFileChooser( | 67 PP_Resource PepperInProcessResourceCreation::CreateFileChooser( |
| 69 PP_Instance instance, | 68 PP_Instance instance, |
| 70 PP_FileChooserMode_Dev mode, | 69 PP_FileChooserMode_Dev mode, |
| 71 const PP_Var& accept_types) { | 70 const PP_Var& accept_types) { |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 } | 131 } |
| 133 | 132 |
| 134 PP_Resource PepperInProcessResourceCreation::CreateWebSocket( | 133 PP_Resource PepperInProcessResourceCreation::CreateWebSocket( |
| 135 PP_Instance instance) { | 134 PP_Instance instance) { |
| 136 return (new ppapi::proxy::WebSocketResource( | 135 return (new ppapi::proxy::WebSocketResource( |
| 137 host_impl_->in_process_router()->GetPluginConnection(instance), | 136 host_impl_->in_process_router()->GetPluginConnection(instance), |
| 138 instance))->GetReference(); | 137 instance))->GetReference(); |
| 139 } | 138 } |
| 140 | 139 |
| 141 } // namespace content | 140 } // namespace content |
| OLD | NEW |