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: { |
| 50 PpapiHostMsg_Graphics2D_Create::Schema::Param msg_params; |
| 51 if (!PpapiHostMsg_Graphics2D_Create::Read(&message, &msg_params)) { |
| 52 NOTREACHED(); |
| 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 */)); |
| 59 } |
48 } | 60 } |
49 } | 61 } |
50 return scoped_ptr<ResourceHost>(); | 62 return scoped_ptr<ResourceHost>(); |
51 } | 63 } |
52 | 64 |
53 const ppapi::PpapiPermissions& | 65 const ppapi::PpapiPermissions& |
54 ContentRendererPepperHostFactory::GetPermissions() const { | 66 ContentRendererPepperHostFactory::GetPermissions() const { |
55 return host_->GetPpapiHost()->permissions(); | 67 return host_->GetPpapiHost()->permissions(); |
56 } | 68 } |
57 | 69 |
58 } // namespace content | 70 } // namespace content |
OLD | NEW |