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/ppapi_plugin_instance.h" | 5 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 scoped_ptr<const char*[]> array(new const char*[vector.size()]); | 305 scoped_ptr<const char*[]> array(new const char*[vector.size()]); |
306 for (size_t i = 0; i < vector.size(); ++i) | 306 for (size_t i = 0; i < vector.size(); ++i) |
307 array[i] = vector[i].c_str(); | 307 array[i] = vector[i].c_str(); |
308 return array.Pass(); | 308 return array.Pass(); |
309 } | 309 } |
310 | 310 |
311 } // namespace | 311 } // namespace |
312 | 312 |
313 // static | 313 // static |
314 PluginInstance* PluginInstance::Create(PluginDelegate* delegate, | 314 PluginInstance* PluginInstance::Create(PluginDelegate* delegate, |
| 315 content::RenderView* render_view, |
315 PluginModule* module, | 316 PluginModule* module, |
316 WebPluginContainer* container, | 317 WebPluginContainer* container, |
317 const GURL& plugin_url) { | 318 const GURL& plugin_url) { |
318 base::Callback<const void*(const char*)> get_plugin_interface_func = | 319 base::Callback<const void*(const char*)> get_plugin_interface_func = |
319 base::Bind(&PluginModule::GetPluginInterface, module); | 320 base::Bind(&PluginModule::GetPluginInterface, module); |
320 PPP_Instance_Combined* ppp_instance_combined = | 321 PPP_Instance_Combined* ppp_instance_combined = |
321 PPP_Instance_Combined::Create(get_plugin_interface_func); | 322 PPP_Instance_Combined::Create(get_plugin_interface_func); |
322 if (!ppp_instance_combined) | 323 if (!ppp_instance_combined) |
323 return NULL; | 324 return NULL; |
324 return new PluginInstance(delegate, module, ppp_instance_combined, container, | 325 return new PluginInstance(delegate, render_view, module, |
325 plugin_url); | 326 ppp_instance_combined, container, plugin_url); |
326 } | 327 } |
327 | 328 |
328 PluginInstance::NaClDocumentLoader::NaClDocumentLoader() | 329 PluginInstance::NaClDocumentLoader::NaClDocumentLoader() |
329 : finished_loading_(false) { | 330 : finished_loading_(false) { |
330 } | 331 } |
331 | 332 |
332 PluginInstance::NaClDocumentLoader::~NaClDocumentLoader(){ | 333 PluginInstance::NaClDocumentLoader::~NaClDocumentLoader(){ |
333 } | 334 } |
334 | 335 |
335 void PluginInstance::NaClDocumentLoader::ReplayReceivedData( | 336 void PluginInstance::NaClDocumentLoader::ReplayReceivedData( |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 void PluginInstance::GamepadImpl::Sample(PP_Instance /* instance */, | 383 void PluginInstance::GamepadImpl::Sample(PP_Instance /* instance */, |
383 PP_GamepadsSampleData* data) { | 384 PP_GamepadsSampleData* data) { |
384 WebKit::WebGamepads webkit_data; | 385 WebKit::WebGamepads webkit_data; |
385 delegate_->SampleGamepads(&webkit_data); | 386 delegate_->SampleGamepads(&webkit_data); |
386 ConvertWebKitGamepadData( | 387 ConvertWebKitGamepadData( |
387 *reinterpret_cast<const ::ppapi::WebKitGamepads*>(&webkit_data), data); | 388 *reinterpret_cast<const ::ppapi::WebKitGamepads*>(&webkit_data), data); |
388 } | 389 } |
389 | 390 |
390 PluginInstance::PluginInstance( | 391 PluginInstance::PluginInstance( |
391 PluginDelegate* delegate, | 392 PluginDelegate* delegate, |
| 393 content::RenderView* render_view, |
392 PluginModule* module, | 394 PluginModule* module, |
393 ::ppapi::PPP_Instance_Combined* instance_interface, | 395 ::ppapi::PPP_Instance_Combined* instance_interface, |
394 WebPluginContainer* container, | 396 WebPluginContainer* container, |
395 const GURL& plugin_url) | 397 const GURL& plugin_url) |
396 : delegate_(delegate), | 398 : delegate_(delegate), |
| 399 render_view_(render_view), |
397 module_(module), | 400 module_(module), |
398 instance_interface_(instance_interface), | 401 instance_interface_(instance_interface), |
399 pp_instance_(0), | 402 pp_instance_(0), |
400 container_(container), | 403 container_(container), |
401 layer_bound_to_fullscreen_(false), | 404 layer_bound_to_fullscreen_(false), |
402 plugin_url_(plugin_url), | 405 plugin_url_(plugin_url), |
403 full_frame_(false), | 406 full_frame_(false), |
404 sent_initial_did_change_view_(false), | 407 sent_initial_did_change_view_(false), |
405 view_change_weak_ptr_factory_(this), | 408 view_change_weak_ptr_factory_(this), |
406 bound_graphics_2d_platform_(NULL), | 409 bound_graphics_2d_platform_(NULL), |
(...skipping 2192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2599 screen_size_for_fullscreen_ = gfx::Size(); | 2602 screen_size_for_fullscreen_ = gfx::Size(); |
2600 WebElement element = container_->element(); | 2603 WebElement element = container_->element(); |
2601 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); | 2604 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); |
2602 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); | 2605 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); |
2603 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); | 2606 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); |
2604 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); | 2607 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); |
2605 } | 2608 } |
2606 | 2609 |
2607 } // namespace ppapi | 2610 } // namespace ppapi |
2608 } // namespace webkit | 2611 } // namespace webkit |
OLD | NEW |