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 "content/renderer/pepper/pepper_plugin_instance_impl.h" | 5 #include "content/renderer/pepper/pepper_plugin_instance_impl.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 2738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2749 return PP_ERROR_FAILED; | 2749 return PP_ERROR_FAILED; |
2750 | 2750 |
2751 WebDocument document = container_->element().document(); | 2751 WebDocument document = container_->element().document(); |
2752 WebFrame* frame = document.frame(); | 2752 WebFrame* frame = document.frame(); |
2753 if (!frame) | 2753 if (!frame) |
2754 return PP_ERROR_FAILED; | 2754 return PP_ERROR_FAILED; |
2755 | 2755 |
2756 ppapi::URLRequestInfoData completed_request = request; | 2756 ppapi::URLRequestInfoData completed_request = request; |
2757 | 2757 |
2758 WebURLRequest web_request; | 2758 WebURLRequest web_request; |
2759 if (!CreateWebURLRequest(&completed_request, frame, &web_request)) | 2759 if (!CreateWebURLRequest(&completed_request, |
2760 WebURLRequest::TargetIsMainFrame, | |
yzshen1
2013/09/03 18:13:40
Is it possible that this navigate happens in a sub
Bernhard Bauer
2013/09/03 20:58:02
Hm, good point! Fixed.
| |
2761 frame, | |
2762 &web_request)) | |
2760 return PP_ERROR_FAILED; | 2763 return PP_ERROR_FAILED; |
2761 web_request.setFirstPartyForCookies(document.firstPartyForCookies()); | 2764 web_request.setFirstPartyForCookies(document.firstPartyForCookies()); |
2762 web_request.setHasUserGesture(from_user_action); | 2765 web_request.setHasUserGesture(from_user_action); |
2763 | 2766 |
2764 GURL gurl(web_request.url()); | 2767 GURL gurl(web_request.url()); |
2765 if (gurl.SchemeIs("javascript")) { | 2768 if (gurl.SchemeIs("javascript")) { |
2766 // In imitation of the NPAPI implementation, only |target_frame == frame| is | 2769 // In imitation of the NPAPI implementation, only |target_frame == frame| is |
2767 // allowed for security reasons. | 2770 // allowed for security reasons. |
2768 WebFrame* target_frame = | 2771 WebFrame* target_frame = |
2769 frame->view()->findFrameByName(WebString::fromUTF8(target), frame); | 2772 frame->view()->findFrameByName(WebString::fromUTF8(target), frame); |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2906 // Running out-of-process. Initiate an IPC call to notify the plugin | 2909 // Running out-of-process. Initiate an IPC call to notify the plugin |
2907 // process. | 2910 // process. |
2908 ppapi::proxy::HostDispatcher* dispatcher = | 2911 ppapi::proxy::HostDispatcher* dispatcher = |
2909 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); | 2912 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); |
2910 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( | 2913 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( |
2911 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); | 2914 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); |
2912 } | 2915 } |
2913 } | 2916 } |
2914 | 2917 |
2915 } // namespace content | 2918 } // namespace content |
OLD | NEW |