| 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/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/linked_ptr.h" | 10 #include "base/memory/linked_ptr.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 #include "webkit/plugins/ppapi/host_globals.h" | 74 #include "webkit/plugins/ppapi/host_globals.h" |
| 75 #include "webkit/plugins/ppapi/message_channel.h" | 75 #include "webkit/plugins/ppapi/message_channel.h" |
| 76 #include "webkit/plugins/ppapi/npapi_glue.h" | 76 #include "webkit/plugins/ppapi/npapi_glue.h" |
| 77 #include "webkit/plugins/ppapi/plugin_module.h" | 77 #include "webkit/plugins/ppapi/plugin_module.h" |
| 78 #include "webkit/plugins/ppapi/plugin_object.h" | 78 #include "webkit/plugins/ppapi/plugin_object.h" |
| 79 #include "webkit/plugins/ppapi/ppb_buffer_impl.h" | 79 #include "webkit/plugins/ppapi/ppb_buffer_impl.h" |
| 80 #include "webkit/plugins/ppapi/ppb_graphics_2d_impl.h" | 80 #include "webkit/plugins/ppapi/ppb_graphics_2d_impl.h" |
| 81 #include "webkit/plugins/ppapi/ppb_graphics_3d_impl.h" | 81 #include "webkit/plugins/ppapi/ppb_graphics_3d_impl.h" |
| 82 #include "webkit/plugins/ppapi/ppb_image_data_impl.h" | 82 #include "webkit/plugins/ppapi/ppb_image_data_impl.h" |
| 83 #include "webkit/plugins/ppapi/ppb_url_loader_impl.h" | 83 #include "webkit/plugins/ppapi/ppb_url_loader_impl.h" |
| 84 #include "webkit/plugins/ppapi/ppb_url_request_info_impl.h" | 84 #include "webkit/plugins/ppapi/url_request_info_util.h" |
| 85 #include "webkit/plugins/ppapi/ppp_pdf.h" | 85 #include "webkit/plugins/ppapi/ppp_pdf.h" |
| 86 #include "webkit/plugins/sad_plugin.h" | 86 #include "webkit/plugins/sad_plugin.h" |
| 87 | 87 |
| 88 #if defined(OS_MACOSX) | 88 #if defined(OS_MACOSX) |
| 89 #include "printing/metafile_impl.h" | 89 #include "printing/metafile_impl.h" |
| 90 #if !defined(USE_SKIA) | 90 #if !defined(USE_SKIA) |
| 91 #include "base/mac/mac_util.h" | 91 #include "base/mac/mac_util.h" |
| 92 #include "base/mac/scoped_cftyperef.h" | 92 #include "base/mac/scoped_cftyperef.h" |
| 93 #endif // !defined(USE_SKIA) | 93 #endif // !defined(USE_SKIA) |
| 94 #endif // defined(OS_MACOSX) | 94 #endif // defined(OS_MACOSX) |
| (...skipping 1555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1650 flash_fullscreen_ = flash_fullscreen; | 1650 flash_fullscreen_ = flash_fullscreen; |
| 1651 if (is_mouselock_pending && !delegate()->IsMouseLocked(this)) { | 1651 if (is_mouselock_pending && !delegate()->IsMouseLocked(this)) { |
| 1652 if (!delegate()->LockMouse(this)) | 1652 if (!delegate()->LockMouse(this)) |
| 1653 TrackedCallback::ClearAndRun(&lock_mouse_callback_, PP_ERROR_FAILED); | 1653 TrackedCallback::ClearAndRun(&lock_mouse_callback_, PP_ERROR_FAILED); |
| 1654 } | 1654 } |
| 1655 | 1655 |
| 1656 if (PluginHasFocus() != old_plugin_focus) | 1656 if (PluginHasFocus() != old_plugin_focus) |
| 1657 SendFocusChangeNotification(); | 1657 SendFocusChangeNotification(); |
| 1658 } | 1658 } |
| 1659 | 1659 |
| 1660 int32_t PluginInstance::Navigate(PPB_URLRequestInfo_Impl* request, | 1660 int32_t PluginInstance::Navigate(const ::ppapi::URLRequestInfoData& request, |
| 1661 const char* target, | 1661 const char* target, |
| 1662 bool from_user_action) { | 1662 bool from_user_action) { |
| 1663 if (!container_) | 1663 if (!container_) |
| 1664 return PP_ERROR_FAILED; | 1664 return PP_ERROR_FAILED; |
| 1665 | 1665 |
| 1666 WebDocument document = container_->element().document(); | 1666 WebDocument document = container_->element().document(); |
| 1667 WebFrame* frame = document.frame(); | 1667 WebFrame* frame = document.frame(); |
| 1668 if (!frame) | 1668 if (!frame) |
| 1669 return PP_ERROR_FAILED; | 1669 return PP_ERROR_FAILED; |
| 1670 | 1670 |
| 1671 ::ppapi::URLRequestInfoData completed_request = request; |
| 1672 |
| 1671 WebURLRequest web_request; | 1673 WebURLRequest web_request; |
| 1672 if (!request->ToWebURLRequest(frame, &web_request)) | 1674 if (!CreateWebURLRequest(&completed_request, frame, &web_request)) |
| 1673 return PP_ERROR_FAILED; | 1675 return PP_ERROR_FAILED; |
| 1674 web_request.setFirstPartyForCookies(document.firstPartyForCookies()); | 1676 web_request.setFirstPartyForCookies(document.firstPartyForCookies()); |
| 1675 web_request.setHasUserGesture(from_user_action); | 1677 web_request.setHasUserGesture(from_user_action); |
| 1676 | 1678 |
| 1677 GURL gurl(web_request.url()); | 1679 GURL gurl(web_request.url()); |
| 1678 if (gurl.SchemeIs("javascript")) { | 1680 if (gurl.SchemeIs("javascript")) { |
| 1679 // In imitation of the NPAPI implementation, only |target_frame == frame| is | 1681 // In imitation of the NPAPI implementation, only |target_frame == frame| is |
| 1680 // allowed for security reasons. | 1682 // allowed for security reasons. |
| 1681 WebFrame* target_frame = | 1683 WebFrame* target_frame = |
| 1682 frame->view()->findFrameByName(WebString::fromUTF8(target), frame); | 1684 frame->view()->findFrameByName(WebString::fromUTF8(target), frame); |
| (...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2666 screen_size_for_fullscreen_ = gfx::Size(); | 2668 screen_size_for_fullscreen_ = gfx::Size(); |
| 2667 WebElement element = container_->element(); | 2669 WebElement element = container_->element(); |
| 2668 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); | 2670 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); |
| 2669 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); | 2671 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); |
| 2670 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); | 2672 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); |
| 2671 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); | 2673 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); |
| 2672 } | 2674 } |
| 2673 | 2675 |
| 2674 } // namespace ppapi | 2676 } // namespace ppapi |
| 2675 } // namespace webkit | 2677 } // namespace webkit |
| OLD | NEW |