| 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 "content/renderer/pepper/pepper_audio_input_host.h" |
| 8 #include "content/renderer/pepper/pepper_file_chooser_host.h" | 9 #include "content/renderer/pepper/pepper_file_chooser_host.h" |
| 9 #include "content/renderer/pepper/pepper_flash_host.h" | 10 #include "content/renderer/pepper/pepper_flash_host.h" |
| 10 #include "content/renderer/pepper/pepper_websocket_host.h" | 11 #include "content/renderer/pepper/pepper_websocket_host.h" |
| 11 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" | 12 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" |
| 12 #include "ppapi/host/resource_host.h" | 13 #include "ppapi/host/resource_host.h" |
| 13 #include "ppapi/proxy/ppapi_messages.h" | 14 #include "ppapi/proxy/ppapi_messages.h" |
| 14 | 15 |
| 15 using ppapi::host::ResourceHost; | 16 using ppapi::host::ResourceHost; |
| 16 | 17 |
| 17 namespace content { | 18 namespace content { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 44 | 45 |
| 45 // Resources for dev interfaces. | 46 // Resources for dev interfaces. |
| 46 // TODO(brettw) when we support any public or private interfaces, put them in | 47 // TODO(brettw) when we support any public or private interfaces, put them in |
| 47 // a separate switch above. | 48 // a separate switch above. |
| 48 | 49 |
| 49 // TODO(brettw) put back this dev check! This was removed to fix issue 138902 | 50 // TODO(brettw) put back this dev check! This was removed to fix issue 138902 |
| 50 // where the permissions for bundled Flash (but not Flash that you specify | 51 // where the permissions for bundled Flash (but not Flash that you specify |
| 51 // on the command line, making it difficult to test) are incorrect. | 52 // on the command line, making it difficult to test) are incorrect. |
| 52 /*if (GetPermissions().HasPermission(ppapi::PERMISSION_DEV))*/ { | 53 /*if (GetPermissions().HasPermission(ppapi::PERMISSION_DEV))*/ { |
| 53 switch (message.type()) { | 54 switch (message.type()) { |
| 55 case PpapiHostMsg_AudioInput_Create::ID: |
| 56 return scoped_ptr<ResourceHost>(new PepperAudioInputHost( |
| 57 host_, instance, params.pp_resource())); |
| 54 case PpapiHostMsg_FileChooser_Create::ID: | 58 case PpapiHostMsg_FileChooser_Create::ID: |
| 55 return scoped_ptr<ResourceHost>(new PepperFileChooserHost( | 59 return scoped_ptr<ResourceHost>(new PepperFileChooserHost( |
| 56 host_, instance, params.pp_resource())); | 60 host_, instance, params.pp_resource())); |
| 57 } | 61 } |
| 58 } | 62 } |
| 59 | 63 |
| 60 // Resources for Flash interfaces. | 64 // Resources for Flash interfaces. |
| 61 if (GetPermissions().HasPermission(ppapi::PERMISSION_FLASH)) { | 65 if (GetPermissions().HasPermission(ppapi::PERMISSION_FLASH)) { |
| 62 switch (message.type()) { | 66 switch (message.type()) { |
| 63 case PpapiHostMsg_Flash_Create::ID: | 67 case PpapiHostMsg_Flash_Create::ID: |
| 64 return scoped_ptr<ResourceHost>(new PepperFlashHost( | 68 return scoped_ptr<ResourceHost>(new PepperFlashHost( |
| 65 host_, instance, params.pp_resource())); | 69 host_, instance, params.pp_resource())); |
| 66 } | 70 } |
| 67 } | 71 } |
| 68 | 72 |
| 69 return scoped_ptr<ResourceHost>(); | 73 return scoped_ptr<ResourceHost>(); |
| 70 } | 74 } |
| 71 | 75 |
| 72 const ppapi::PpapiPermissions& | 76 const ppapi::PpapiPermissions& |
| 73 ContentRendererPepperHostFactory::GetPermissions() const { | 77 ContentRendererPepperHostFactory::GetPermissions() const { |
| 74 return host_->GetPpapiHost()->permissions(); | 78 return host_->GetPpapiHost()->permissions(); |
| 75 } | 79 } |
| 76 | 80 |
| 77 } // namespace content | 81 } // namespace content |
| OLD | NEW |