OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
993 int32_t PluginInstance::Navigate(PPB_URLRequestInfo_Impl* request, | 993 int32_t PluginInstance::Navigate(PPB_URLRequestInfo_Impl* request, |
994 const char* target, | 994 const char* target, |
995 bool from_user_action) { | 995 bool from_user_action) { |
996 if (!container_) | 996 if (!container_) |
997 return PP_ERROR_FAILED; | 997 return PP_ERROR_FAILED; |
998 | 998 |
999 WebDocument document = container_->element().document(); | 999 WebDocument document = container_->element().document(); |
1000 WebFrame* frame = document.frame(); | 1000 WebFrame* frame = document.frame(); |
1001 if (!frame) | 1001 if (!frame) |
1002 return PP_ERROR_FAILED; | 1002 return PP_ERROR_FAILED; |
1003 WebURLRequest web_request(request->ToWebURLRequest(frame)); | 1003 |
| 1004 WebURLRequest web_request; |
| 1005 if (!request->ToWebURLRequest(frame, &web_request)) |
| 1006 return PP_ERROR_FAILED; |
1004 web_request.setFirstPartyForCookies(document.firstPartyForCookies()); | 1007 web_request.setFirstPartyForCookies(document.firstPartyForCookies()); |
1005 web_request.setHasUserGesture(from_user_action); | 1008 web_request.setHasUserGesture(from_user_action); |
1006 | 1009 |
1007 GURL gurl(web_request.url()); | 1010 GURL gurl(web_request.url()); |
1008 if (gurl.SchemeIs("javascript")) { | 1011 if (gurl.SchemeIs("javascript")) { |
1009 // In imitation of the NPAPI implementation, only |target_frame == frame| is | 1012 // In imitation of the NPAPI implementation, only |target_frame == frame| is |
1010 // allowed for security reasons. | 1013 // allowed for security reasons. |
1011 WebFrame* target_frame = | 1014 WebFrame* target_frame = |
1012 frame->view()->findFrameByName(WebString::fromUTF8(target), frame); | 1015 frame->view()->findFrameByName(WebString::fromUTF8(target), frame); |
1013 if (target_frame != frame) | 1016 if (target_frame != frame) |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1548 } | 1551 } |
1549 | 1552 |
1550 void PluginInstance::DoSetCursor(WebCursorInfo* cursor) { | 1553 void PluginInstance::DoSetCursor(WebCursorInfo* cursor) { |
1551 cursor_.reset(cursor); | 1554 cursor_.reset(cursor); |
1552 if (fullscreen_container_) | 1555 if (fullscreen_container_) |
1553 fullscreen_container_->DidChangeCursor(*cursor); | 1556 fullscreen_container_->DidChangeCursor(*cursor); |
1554 } | 1557 } |
1555 | 1558 |
1556 } // namespace ppapi | 1559 } // namespace ppapi |
1557 } // namespace webkit | 1560 } // namespace webkit |
OLD | NEW |