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_graphics_2d_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_Graphics2D_Create::ID: | |
|
brettw
2012/10/02 21:18:57
You'll need {} around the contents of this or else
victorhsieh
2012/10/02 22:15:03
Done.
| |
| 50 PpapiHostMsg_Graphics2D_Create::Schema::Param msg_params; | |
| 51 if (!PpapiHostMsg_Graphics2D_Create::Read(&message, &msg_params)) { | |
| 52 LOG(ERROR) << "Failed to parse message"; | |
|
brettw
2012/10/02 21:18:57
I'd use NOTREACHED() instead here.
victorhsieh
2012/10/02 22:15:03
Done.
| |
| 53 return scoped_ptr<ResourceHost>(); | |
| 54 } | |
| 55 return scoped_ptr<ResourceHost>( | |
| 56 PepperGraphics2DHost::Create(host_, instance, params.pp_resource(), | |
| 57 msg_params.a /* PP_Size */, | |
| 58 msg_params.b /* PP_Bool */)); | |
| 48 } | 59 } |
| 49 } | 60 } |
| 50 return scoped_ptr<ResourceHost>(); | 61 return scoped_ptr<ResourceHost>(); |
| 51 } | 62 } |
| 52 | 63 |
| 53 const ppapi::PpapiPermissions& | 64 const ppapi::PpapiPermissions& |
| 54 ContentRendererPepperHostFactory::GetPermissions() const { | 65 ContentRendererPepperHostFactory::GetPermissions() const { |
| 55 return host_->GetPpapiHost()->permissions(); | 66 return host_->GetPpapiHost()->permissions(); |
| 56 } | 67 } |
| 57 | 68 |
| 58 } // namespace content | 69 } // namespace content |
| OLD | NEW |