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 980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
991 int32_t PluginInstance::Navigate(PPB_URLRequestInfo_Impl* request, | 991 int32_t PluginInstance::Navigate(PPB_URLRequestInfo_Impl* request, |
992 const char* target, | 992 const char* target, |
993 bool from_user_action) { | 993 bool from_user_action) { |
994 if (!container_) | 994 if (!container_) |
995 return PP_ERROR_FAILED; | 995 return PP_ERROR_FAILED; |
996 | 996 |
997 WebDocument document = container_->element().document(); | 997 WebDocument document = container_->element().document(); |
998 WebFrame* frame = document.frame(); | 998 WebFrame* frame = document.frame(); |
999 if (!frame) | 999 if (!frame) |
1000 return PP_ERROR_FAILED; | 1000 return PP_ERROR_FAILED; |
1001 WebURLRequest web_request(request->ToWebURLRequest(frame)); | 1001 |
| 1002 WebURLRequest web_request; |
| 1003 if (!request->ToWebURLRequest(frame, &web_request)) |
| 1004 return PP_ERROR_FAILED; |
1002 web_request.setFirstPartyForCookies(document.firstPartyForCookies()); | 1005 web_request.setFirstPartyForCookies(document.firstPartyForCookies()); |
1003 web_request.setHasUserGesture(from_user_action); | 1006 web_request.setHasUserGesture(from_user_action); |
1004 | 1007 |
1005 GURL gurl(web_request.url()); | 1008 GURL gurl(web_request.url()); |
1006 if (gurl.SchemeIs("javascript")) { | 1009 if (gurl.SchemeIs("javascript")) { |
1007 // In imitation of the NPAPI implementation, only |target_frame == frame| is | 1010 // In imitation of the NPAPI implementation, only |target_frame == frame| is |
1008 // allowed for security reasons. | 1011 // allowed for security reasons. |
1009 WebFrame* target_frame = | 1012 WebFrame* target_frame = |
1010 frame->view()->findFrameByName(WebString::fromUTF8(target), frame); | 1013 frame->view()->findFrameByName(WebString::fromUTF8(target), frame); |
1011 if (target_frame != frame) | 1014 if (target_frame != frame) |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1546 } | 1549 } |
1547 | 1550 |
1548 void PluginInstance::DoSetCursor(WebCursorInfo* cursor) { | 1551 void PluginInstance::DoSetCursor(WebCursorInfo* cursor) { |
1549 cursor_.reset(cursor); | 1552 cursor_.reset(cursor); |
1550 if (fullscreen_container_) | 1553 if (fullscreen_container_) |
1551 fullscreen_container_->DidChangeCursor(*cursor); | 1554 fullscreen_container_->DidChangeCursor(*cursor); |
1552 } | 1555 } |
1553 | 1556 |
1554 } // namespace ppapi | 1557 } // namespace ppapi |
1555 } // namespace webkit | 1558 } // namespace webkit |
OLD | NEW |