Chromium Code Reviews| 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_file_chooser_host.h" | 8 #include "content/renderer/pepper/pepper_file_chooser_host.h" |
| 9 #include "content/renderer/pepper/pepper_flash_host.h" | |
| 9 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" | 10 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" |
| 10 #include "ppapi/host/resource_host.h" | 11 #include "ppapi/host/resource_host.h" |
| 11 #include "ppapi/proxy/ppapi_messages.h" | 12 #include "ppapi/proxy/ppapi_messages.h" |
| 12 | 13 |
| 13 using ppapi::host::ResourceHost; | 14 using ppapi::host::ResourceHost; |
| 14 | 15 |
| 15 namespace content { | 16 namespace content { |
| 16 | 17 |
| 17 ContentRendererPepperHostFactory::ContentRendererPepperHostFactory( | 18 ContentRendererPepperHostFactory::ContentRendererPepperHostFactory( |
| 18 RendererPpapiHostImpl* host) | 19 RendererPpapiHostImpl* host) |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 38 // a separate switch above. | 39 // a separate switch above. |
| 39 | 40 |
| 40 // TODO(brettw) put back this dev check! This was removed to fix issue 138902 | 41 // TODO(brettw) put back this dev check! This was removed to fix issue 138902 |
| 41 // where the permissions for bundled Flash (but not Flash that you specify | 42 // where the permissions for bundled Flash (but not Flash that you specify |
| 42 // on the command line, making it difficult to test) are incorrect. | 43 // on the command line, making it difficult to test) are incorrect. |
| 43 /*if (GetPermissions().HasPermission(ppapi::PERMISSION_DEV))*/ { | 44 /*if (GetPermissions().HasPermission(ppapi::PERMISSION_DEV))*/ { |
| 44 switch (message.type()) { | 45 switch (message.type()) { |
| 45 case PpapiHostMsg_FileChooser_Create::ID: | 46 case PpapiHostMsg_FileChooser_Create::ID: |
| 46 return scoped_ptr<ResourceHost>(new PepperFileChooserHost( | 47 return scoped_ptr<ResourceHost>(new PepperFileChooserHost( |
| 47 host_, instance, params.pp_resource())); | 48 host_, instance, params.pp_resource())); |
| 49 case PpapiHostMsg_Flash_Create::ID: | |
|
yzshen1
2012/10/10 18:17:39
I think it is okay to check PERMISSION_FLASH.
raymes
2012/10/11 18:39:26
Done.
| |
| 50 return scoped_ptr<ResourceHost>(new PepperFlashHost( | |
| 51 host_, instance, params.pp_resource())); | |
| 48 } | 52 } |
| 49 } | 53 } |
| 50 return scoped_ptr<ResourceHost>(); | 54 return scoped_ptr<ResourceHost>(); |
| 51 } | 55 } |
| 52 | 56 |
| 53 const ppapi::PpapiPermissions& | 57 const ppapi::PpapiPermissions& |
| 54 ContentRendererPepperHostFactory::GetPermissions() const { | 58 ContentRendererPepperHostFactory::GetPermissions() const { |
| 55 return host_->GetPpapiHost()->permissions(); | 59 return host_->GetPpapiHost()->permissions(); |
| 56 } | 60 } |
| 57 | 61 |
| 58 } // namespace content | 62 } // namespace content |
| OLD | NEW |