| 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 "chrome/renderer/pepper/chrome_renderer_pepper_host_factory.h" | 5 #include "chrome/renderer/pepper/chrome_renderer_pepper_host_factory.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/renderer/pepper/pepper_extensions_common_host.h" |
| 8 #include "chrome/renderer/pepper/pepper_flash_font_file_host.h" | 9 #include "chrome/renderer/pepper/pepper_flash_font_file_host.h" |
| 9 #include "chrome/renderer/pepper/pepper_flash_fullscreen_host.h" | 10 #include "chrome/renderer/pepper/pepper_flash_fullscreen_host.h" |
| 10 #include "chrome/renderer/pepper/pepper_flash_menu_host.h" | 11 #include "chrome/renderer/pepper/pepper_flash_menu_host.h" |
| 11 #include "chrome/renderer/pepper/pepper_flash_renderer_host.h" | 12 #include "chrome/renderer/pepper/pepper_flash_renderer_host.h" |
| 12 #include "content/public/renderer/renderer_ppapi_host.h" | 13 #include "content/public/renderer/renderer_ppapi_host.h" |
| 13 #include "ppapi/host/ppapi_host.h" | 14 #include "ppapi/host/ppapi_host.h" |
| 14 #include "ppapi/host/resource_host.h" | 15 #include "ppapi/host/resource_host.h" |
| 15 #include "ppapi/proxy/ppapi_messages.h" | 16 #include "ppapi/proxy/ppapi_messages.h" |
| 16 #include "ppapi/proxy/ppapi_message_utils.h" | 17 #include "ppapi/proxy/ppapi_message_utils.h" |
| 17 #include "ppapi/shared_impl/ppapi_permissions.h" | 18 #include "ppapi/shared_impl/ppapi_permissions.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 33 ppapi::host::PpapiHost* host, | 34 ppapi::host::PpapiHost* host, |
| 34 const ppapi::proxy::ResourceMessageCallParams& params, | 35 const ppapi::proxy::ResourceMessageCallParams& params, |
| 35 PP_Instance instance, | 36 PP_Instance instance, |
| 36 const IPC::Message& message) { | 37 const IPC::Message& message) { |
| 37 DCHECK(host == host_->GetPpapiHost()); | 38 DCHECK(host == host_->GetPpapiHost()); |
| 38 | 39 |
| 39 // Make sure the plugin is giving us a valid instance for this resource. | 40 // Make sure the plugin is giving us a valid instance for this resource. |
| 40 if (!host_->IsValidInstance(instance)) | 41 if (!host_->IsValidInstance(instance)) |
| 41 return scoped_ptr<ResourceHost>(); | 42 return scoped_ptr<ResourceHost>(); |
| 42 | 43 |
| 44 // Dev interfaces. |
| 45 if (host_->GetPpapiHost()->permissions().HasPermission( |
| 46 ppapi::PERMISSION_DEV)) { |
| 47 switch (message.type()) { |
| 48 case PpapiHostMsg_ExtensionsCommon_Create::ID: { |
| 49 return scoped_ptr<ResourceHost>(PepperExtensionsCommonHost::Create( |
| 50 host_, instance, params.pp_resource())); |
| 51 } |
| 52 } |
| 53 } |
| 54 |
| 43 if (host_->GetPpapiHost()->permissions().HasPermission( | 55 if (host_->GetPpapiHost()->permissions().HasPermission( |
| 44 ppapi::PERMISSION_FLASH)) { | 56 ppapi::PERMISSION_FLASH)) { |
| 45 switch (message.type()) { | 57 switch (message.type()) { |
| 46 case PpapiHostMsg_Flash_Create::ID: { | 58 case PpapiHostMsg_Flash_Create::ID: { |
| 47 return scoped_ptr<ResourceHost>(new PepperFlashRendererHost( | 59 return scoped_ptr<ResourceHost>(new PepperFlashRendererHost( |
| 48 host_, instance, params.pp_resource())); | 60 host_, instance, params.pp_resource())); |
| 49 } | 61 } |
| 50 case PpapiHostMsg_FlashFontFile_Create::ID: { | 62 case PpapiHostMsg_FlashFontFile_Create::ID: { |
| 51 ppapi::proxy::SerializedFontDescription description; | 63 ppapi::proxy::SerializedFontDescription description; |
| 52 PP_PrivateFontCharset charset; | 64 PP_PrivateFontCharset charset; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 70 } | 82 } |
| 71 break; | 83 break; |
| 72 } | 84 } |
| 73 } | 85 } |
| 74 } | 86 } |
| 75 | 87 |
| 76 return scoped_ptr<ResourceHost>(); | 88 return scoped_ptr<ResourceHost>(); |
| 77 } | 89 } |
| 78 | 90 |
| 79 } // namespace chrome | 91 } // namespace chrome |
| OLD | NEW |