OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "webkit/plugins/ppapi/resource_creation_impl.h" | 5 #include "webkit/plugins/ppapi/resource_creation_impl.h" |
6 | 6 |
7 #include "ppapi/c/pp_size.h" | 7 #include "ppapi/c/pp_size.h" |
8 #include "ppapi/shared_impl/font_impl.h" | 8 #include "ppapi/shared_impl/font_impl.h" |
9 #include "webkit/plugins/ppapi/common.h" | 9 #include "webkit/plugins/ppapi/common.h" |
10 #include "webkit/plugins/ppapi/ppb_audio_impl.h" | 10 #include "webkit/plugins/ppapi/ppb_audio_impl.h" |
11 #include "webkit/plugins/ppapi/ppb_broker_impl.h" | 11 #include "webkit/plugins/ppapi/ppb_broker_impl.h" |
12 #include "webkit/plugins/ppapi/ppb_buffer_impl.h" | 12 #include "webkit/plugins/ppapi/ppb_buffer_impl.h" |
13 #include "webkit/plugins/ppapi/ppb_directory_reader_impl.h" | 13 #include "webkit/plugins/ppapi/ppb_directory_reader_impl.h" |
14 #include "webkit/plugins/ppapi/ppb_file_chooser_impl.h" | 14 #include "webkit/plugins/ppapi/ppb_file_chooser_impl.h" |
15 #include "webkit/plugins/ppapi/ppb_file_io_impl.h" | 15 #include "webkit/plugins/ppapi/ppb_file_io_impl.h" |
16 #include "webkit/plugins/ppapi/ppb_file_ref_impl.h" | 16 #include "webkit/plugins/ppapi/ppb_file_ref_impl.h" |
17 #include "webkit/plugins/ppapi/ppb_file_system_impl.h" | 17 #include "webkit/plugins/ppapi/ppb_file_system_impl.h" |
| 18 #include "webkit/plugins/ppapi/ppb_flash_menu_impl.h" |
| 19 #include "webkit/plugins/ppapi/ppb_flash_net_connector_impl.h" |
18 #include "webkit/plugins/ppapi/ppb_font_impl.h" | 20 #include "webkit/plugins/ppapi/ppb_font_impl.h" |
19 #include "webkit/plugins/ppapi/ppb_graphics_2d_impl.h" | 21 #include "webkit/plugins/ppapi/ppb_graphics_2d_impl.h" |
20 #include "webkit/plugins/ppapi/ppb_image_data_impl.h" | 22 #include "webkit/plugins/ppapi/ppb_image_data_impl.h" |
21 | 23 |
22 namespace webkit { | 24 namespace webkit { |
23 namespace ppapi { | 25 namespace ppapi { |
24 | 26 |
25 ResourceCreationImpl::ResourceCreationImpl(PluginInstance* instance) | 27 ResourceCreationImpl::ResourceCreationImpl(PluginInstance* instance) |
26 : instance_(instance) { | 28 : instance_(instance) { |
27 } | 29 } |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 const char* path) { | 101 const char* path) { |
100 return PPB_FileRef_Impl::Create(file_system, path); | 102 return PPB_FileRef_Impl::Create(file_system, path); |
101 } | 103 } |
102 | 104 |
103 PP_Resource ResourceCreationImpl::CreateFileSystem( | 105 PP_Resource ResourceCreationImpl::CreateFileSystem( |
104 PP_Instance instance, | 106 PP_Instance instance, |
105 PP_FileSystemType_Dev type) { | 107 PP_FileSystemType_Dev type) { |
106 return PPB_FileSystem_Impl::Create(instance, type); | 108 return PPB_FileSystem_Impl::Create(instance, type); |
107 } | 109 } |
108 | 110 |
| 111 PP_Resource ResourceCreationImpl::CreateFlashMenu( |
| 112 PP_Instance instance, |
| 113 const PP_Flash_Menu* menu_data) { |
| 114 return PPB_Flash_Menu_Impl::Create(instance, menu_data); |
| 115 } |
| 116 |
| 117 PP_Resource ResourceCreationImpl::CreateFlashNetConnector( |
| 118 PP_Instance instance) { |
| 119 return PPB_Flash_NetConnector_Impl::Create(instance); |
| 120 } |
| 121 |
109 PP_Resource ResourceCreationImpl::CreateFontObject( | 122 PP_Resource ResourceCreationImpl::CreateFontObject( |
110 PP_Instance pp_instance, | 123 PP_Instance pp_instance, |
111 const PP_FontDescription_Dev* description) { | 124 const PP_FontDescription_Dev* description) { |
112 PluginInstance* instance = ResourceTracker::Get()->GetInstance(pp_instance); | 125 PluginInstance* instance = ResourceTracker::Get()->GetInstance(pp_instance); |
113 if (!instance) | 126 if (!instance) |
114 return 0; | 127 return 0; |
115 | 128 |
116 if (!::ppapi::FontImpl::IsPPFontDescriptionValid(*description)) | 129 if (!::ppapi::FontImpl::IsPPFontDescriptionValid(*description)) |
117 return 0; | 130 return 0; |
118 | 131 |
(...skipping 27 matching lines...) Expand all Loading... |
146 return 0; | 159 return 0; |
147 | 160 |
148 scoped_refptr<PPB_ImageData_Impl> data(new PPB_ImageData_Impl(instance)); | 161 scoped_refptr<PPB_ImageData_Impl> data(new PPB_ImageData_Impl(instance)); |
149 if (!data->Init(format, size.width, size.height, !!init_to_zero)) | 162 if (!data->Init(format, size.width, size.height, !!init_to_zero)) |
150 return 0; | 163 return 0; |
151 return data->GetReference(); | 164 return data->GetReference(); |
152 } | 165 } |
153 | 166 |
154 } // namespace ppapi | 167 } // namespace ppapi |
155 } // namespace webkit | 168 } // namespace webkit |
OLD | NEW |