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 "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/ppb_audio_config_shared.h" | 8 #include "ppapi/shared_impl/ppb_audio_config_shared.h" |
9 #include "ppapi/shared_impl/private/ppb_font_shared.h" | 9 #include "ppapi/shared_impl/private/ppb_browser_font_trusted_shared.h" |
10 #include "ppapi/shared_impl/ppb_input_event_shared.h" | 10 #include "ppapi/shared_impl/ppb_input_event_shared.h" |
11 #include "ppapi/shared_impl/ppb_resource_array_shared.h" | 11 #include "ppapi/shared_impl/ppb_resource_array_shared.h" |
12 #include "ppapi/shared_impl/var.h" | 12 #include "ppapi/shared_impl/var.h" |
13 #include "webkit/plugins/ppapi/common.h" | 13 #include "webkit/plugins/ppapi/common.h" |
14 #include "webkit/plugins/ppapi/ppb_audio_impl.h" | 14 #include "webkit/plugins/ppapi/ppb_audio_impl.h" |
15 #include "webkit/plugins/ppapi/ppb_audio_input_impl.h" | 15 #include "webkit/plugins/ppapi/ppb_audio_input_impl.h" |
16 #include "webkit/plugins/ppapi/ppb_broker_impl.h" | 16 #include "webkit/plugins/ppapi/ppb_broker_impl.h" |
17 #include "webkit/plugins/ppapi/ppb_buffer_impl.h" | 17 #include "webkit/plugins/ppapi/ppb_buffer_impl.h" |
18 #include "webkit/plugins/ppapi/ppb_directory_reader_impl.h" | 18 #include "webkit/plugins/ppapi/ppb_directory_reader_impl.h" |
19 #include "webkit/plugins/ppapi/ppb_file_chooser_impl.h" | 19 #include "webkit/plugins/ppapi/ppb_file_chooser_impl.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 90 |
91 PP_Resource ResourceCreationImpl::CreateAudioInputTrusted( | 91 PP_Resource ResourceCreationImpl::CreateAudioInputTrusted( |
92 PP_Instance instance) { | 92 PP_Instance instance) { |
93 return (new PPB_AudioInput_Impl(instance))->GetReference(); | 93 return (new PPB_AudioInput_Impl(instance))->GetReference(); |
94 } | 94 } |
95 | 95 |
96 PP_Resource ResourceCreationImpl::CreateBroker(PP_Instance instance) { | 96 PP_Resource ResourceCreationImpl::CreateBroker(PP_Instance instance) { |
97 return (new PPB_Broker_Impl(instance))->GetReference(); | 97 return (new PPB_Broker_Impl(instance))->GetReference(); |
98 } | 98 } |
99 | 99 |
| 100 PP_Resource ResourceCreationImpl::CreateBrowserFont( |
| 101 PP_Instance instance, |
| 102 const PP_BrowserFont_Trusted_Description* description) { |
| 103 PluginInstance* plugin_instance = |
| 104 ResourceHelper::PPInstanceToPluginInstance(instance); |
| 105 if (!plugin_instance) |
| 106 return 0; |
| 107 return ::ppapi::PPB_BrowserFont_Trusted_Shared::Create( |
| 108 ::ppapi::OBJECT_IS_IMPL, instance, *description, |
| 109 plugin_instance->delegate()->GetPreferences()); |
| 110 } |
| 111 |
100 PP_Resource ResourceCreationImpl::CreateBuffer(PP_Instance instance, | 112 PP_Resource ResourceCreationImpl::CreateBuffer(PP_Instance instance, |
101 uint32_t size) { | 113 uint32_t size) { |
102 return PPB_Buffer_Impl::Create(instance, size); | 114 return PPB_Buffer_Impl::Create(instance, size); |
103 } | 115 } |
104 | 116 |
105 PP_Resource ResourceCreationImpl::CreateDirectoryReader( | 117 PP_Resource ResourceCreationImpl::CreateDirectoryReader( |
106 PP_Resource directory_ref) { | 118 PP_Resource directory_ref) { |
107 return PPB_DirectoryReader_Impl::Create(directory_ref); | 119 return PPB_DirectoryReader_Impl::Create(directory_ref); |
108 } | 120 } |
109 | 121 |
(...skipping 28 matching lines...) Expand all Loading... |
138 | 150 |
139 PP_Resource ResourceCreationImpl::CreateFlashMessageLoop(PP_Instance instance) { | 151 PP_Resource ResourceCreationImpl::CreateFlashMessageLoop(PP_Instance instance) { |
140 return PPB_Flash_MessageLoop_Impl::Create(instance); | 152 return PPB_Flash_MessageLoop_Impl::Create(instance); |
141 } | 153 } |
142 | 154 |
143 PP_Resource ResourceCreationImpl::CreateFlashNetConnector( | 155 PP_Resource ResourceCreationImpl::CreateFlashNetConnector( |
144 PP_Instance instance) { | 156 PP_Instance instance) { |
145 return (new PPB_Flash_NetConnector_Impl(instance))->GetReference(); | 157 return (new PPB_Flash_NetConnector_Impl(instance))->GetReference(); |
146 } | 158 } |
147 | 159 |
148 PP_Resource ResourceCreationImpl::CreateFontObject( | |
149 PP_Instance instance, | |
150 const PP_FontDescription_Dev* description) { | |
151 PluginInstance* plugin_instance = | |
152 ResourceHelper::PPInstanceToPluginInstance(instance); | |
153 if (!plugin_instance) | |
154 return 0; | |
155 return ::ppapi::PPB_Font_Shared::Create( | |
156 ::ppapi::OBJECT_IS_IMPL, instance, *description, | |
157 plugin_instance->delegate()->GetPreferences()); | |
158 } | |
159 | |
160 PP_Resource ResourceCreationImpl::CreateGraphics2D( | 160 PP_Resource ResourceCreationImpl::CreateGraphics2D( |
161 PP_Instance instance, | 161 PP_Instance instance, |
162 const PP_Size& size, | 162 const PP_Size& size, |
163 PP_Bool is_always_opaque) { | 163 PP_Bool is_always_opaque) { |
164 return PPB_Graphics2D_Impl::Create(instance, size, is_always_opaque); | 164 return PPB_Graphics2D_Impl::Create(instance, size, is_always_opaque); |
165 } | 165 } |
166 | 166 |
167 PP_Resource ResourceCreationImpl::CreateGraphics3D( | 167 PP_Resource ResourceCreationImpl::CreateGraphics3D( |
168 PP_Instance instance, | 168 PP_Instance instance, |
169 PP_Resource share_context, | 169 PP_Resource share_context, |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 data.wheel_delta = *wheel_delta; | 323 data.wheel_delta = *wheel_delta; |
324 data.wheel_ticks = *wheel_ticks; | 324 data.wheel_ticks = *wheel_ticks; |
325 data.wheel_scroll_by_page = PP_ToBool(scroll_by_page); | 325 data.wheel_scroll_by_page = PP_ToBool(scroll_by_page); |
326 | 326 |
327 return (new PPB_InputEvent_Shared(::ppapi::OBJECT_IS_IMPL, | 327 return (new PPB_InputEvent_Shared(::ppapi::OBJECT_IS_IMPL, |
328 instance, data))->GetReference(); | 328 instance, data))->GetReference(); |
329 } | 329 } |
330 | 330 |
331 } // namespace ppapi | 331 } // namespace ppapi |
332 } // namespace webkit | 332 } // namespace webkit |
OLD | NEW |