Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Side by Side Diff: webkit/plugins/ppapi/ppapi_plugin_instance.cc

Issue 10913257: Convert url request info to new proxy API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 1552 matching lines...) Expand 10 before | Expand all | Expand 10 after
1647 flash_fullscreen_ = flash_fullscreen; 1647 flash_fullscreen_ = flash_fullscreen;
1648 if (is_mouselock_pending && !delegate()->IsMouseLocked(this)) { 1648 if (is_mouselock_pending && !delegate()->IsMouseLocked(this)) {
1649 if (!delegate()->LockMouse(this)) 1649 if (!delegate()->LockMouse(this))
1650 TrackedCallback::ClearAndRun(&lock_mouse_callback_, PP_ERROR_FAILED); 1650 TrackedCallback::ClearAndRun(&lock_mouse_callback_, PP_ERROR_FAILED);
1651 } 1651 }
1652 1652
1653 if (PluginHasFocus() != old_plugin_focus) 1653 if (PluginHasFocus() != old_plugin_focus)
1654 SendFocusChangeNotification(); 1654 SendFocusChangeNotification();
1655 } 1655 }
1656 1656
1657 int32_t PluginInstance::Navigate(PPB_URLRequestInfo_Impl* request, 1657 int32_t PluginInstance::Navigate(const ::ppapi::URLRequestInfoData& request,
1658 const char* target, 1658 const char* target,
1659 bool from_user_action) { 1659 bool from_user_action) {
1660 if (!container_) 1660 if (!container_)
1661 return PP_ERROR_FAILED; 1661 return PP_ERROR_FAILED;
1662 1662
1663 WebDocument document = container_->element().document(); 1663 WebDocument document = container_->element().document();
1664 WebFrame* frame = document.frame(); 1664 WebFrame* frame = document.frame();
1665 if (!frame) 1665 if (!frame)
1666 return PP_ERROR_FAILED; 1666 return PP_ERROR_FAILED;
1667 1667
1668 ::ppapi::URLRequestInfoData completed_request = request;
1669
1668 WebURLRequest web_request; 1670 WebURLRequest web_request;
1669 if (!request->ToWebURLRequest(frame, &web_request)) 1671 if (!CreateWebURLRequest(&completed_request, frame, &web_request))
1670 return PP_ERROR_FAILED; 1672 return PP_ERROR_FAILED;
1671 web_request.setFirstPartyForCookies(document.firstPartyForCookies()); 1673 web_request.setFirstPartyForCookies(document.firstPartyForCookies());
1672 web_request.setHasUserGesture(from_user_action); 1674 web_request.setHasUserGesture(from_user_action);
1673 1675
1674 GURL gurl(web_request.url()); 1676 GURL gurl(web_request.url());
1675 if (gurl.SchemeIs("javascript")) { 1677 if (gurl.SchemeIs("javascript")) {
1676 // In imitation of the NPAPI implementation, only |target_frame == frame| is 1678 // In imitation of the NPAPI implementation, only |target_frame == frame| is
1677 // allowed for security reasons. 1679 // allowed for security reasons.
1678 WebFrame* target_frame = 1680 WebFrame* target_frame =
1679 frame->view()->findFrameByName(WebString::fromUTF8(target), frame); 1681 frame->view()->findFrameByName(WebString::fromUTF8(target), frame);
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after
2663 screen_size_for_fullscreen_ = gfx::Size(); 2665 screen_size_for_fullscreen_ = gfx::Size();
2664 WebElement element = container_->element(); 2666 WebElement element = container_->element();
2665 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); 2667 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_);
2666 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); 2668 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_);
2667 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); 2669 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_);
2668 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); 2670 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_);
2669 } 2671 }
2670 2672
2671 } // namespace ppapi 2673 } // namespace ppapi
2672 } // namespace webkit 2674 } // namespace webkit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698