Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/render_frame_proxy.h" | 5 #include "content/renderer/render_frame_proxy.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/lazy_instance.h" | 12 #include "base/lazy_instance.h" |
| 13 #include "content/child/web_url_request_util.h" | 13 #include "content/child/web_url_request_util.h" |
| 14 #include "content/child/webmessageportchannel_impl.h" | 14 #include "content/child/webmessageportchannel_impl.h" |
| 15 #include "content/common/content_security_policy_header.h" | 15 #include "content/common/content_security_policy_header.h" |
| 16 #include "content/common/content_switches_internal.h" | |
| 16 #include "content/common/frame_messages.h" | 17 #include "content/common/frame_messages.h" |
| 17 #include "content/common/frame_owner_properties.h" | 18 #include "content/common/frame_owner_properties.h" |
| 18 #include "content/common/frame_replication_state.h" | 19 #include "content/common/frame_replication_state.h" |
| 19 #include "content/common/input_messages.h" | 20 #include "content/common/input_messages.h" |
| 20 #include "content/common/page_messages.h" | 21 #include "content/common/page_messages.h" |
| 21 #include "content/common/site_isolation_policy.h" | 22 #include "content/common/site_isolation_policy.h" |
| 22 #include "content/common/swapped_out_messages.h" | 23 #include "content/common/swapped_out_messages.h" |
| 23 #include "content/common/view_messages.h" | 24 #include "content/common/view_messages.h" |
| 24 #include "content/renderer/child_frame_compositing_helper.h" | 25 #include "content/renderer/child_frame_compositing_helper.h" |
| 25 #include "content/renderer/render_frame_impl.h" | 26 #include "content/renderer/render_frame_impl.h" |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 431 if (source_frame) { | 432 if (source_frame) { |
| 432 RenderFrameImpl* source_render_frame = | 433 RenderFrameImpl* source_render_frame = |
| 433 RenderFrameImpl::FromWebFrame(source_frame); | 434 RenderFrameImpl::FromWebFrame(source_frame); |
| 434 if (source_render_frame) | 435 if (source_render_frame) |
| 435 params.source_routing_id = source_render_frame->GetRoutingID(); | 436 params.source_routing_id = source_render_frame->GetRoutingID(); |
| 436 } | 437 } |
| 437 | 438 |
| 438 Send(new FrameHostMsg_RouteMessageEvent(routing_id_, params)); | 439 Send(new FrameHostMsg_RouteMessageEvent(routing_id_, params)); |
| 439 } | 440 } |
| 440 | 441 |
| 441 void RenderFrameProxy::initializeChildFrame( | 442 void RenderFrameProxy::initializeChildFrame() { |
| 442 float scale_factor) { | |
| 443 Send(new FrameHostMsg_InitializeChildFrame( | 443 Send(new FrameHostMsg_InitializeChildFrame( |
| 444 routing_id_, scale_factor)); | 444 routing_id_, render_widget_->GetOriginalDeviceScaleFactor())); |
| 445 } | 445 } |
| 446 | 446 |
| 447 void RenderFrameProxy::navigate(const blink::WebURLRequest& request, | 447 void RenderFrameProxy::navigate(const blink::WebURLRequest& request, |
| 448 bool should_replace_current_entry) { | 448 bool should_replace_current_entry) { |
| 449 FrameHostMsg_OpenURL_Params params; | 449 FrameHostMsg_OpenURL_Params params; |
| 450 params.url = request.url(); | 450 params.url = request.url(); |
| 451 params.uses_post = request.httpMethod().utf8() == "POST"; | 451 params.uses_post = request.httpMethod().utf8() == "POST"; |
| 452 params.resource_request_body = GetRequestBodyForWebURLRequest(request); | 452 params.resource_request_body = GetRequestBodyForWebURLRequest(request); |
| 453 params.referrer = Referrer( | 453 params.referrer = Referrer( |
| 454 blink::WebStringToGURL( | 454 blink::WebStringToGURL( |
| 455 request.httpHeaderField(blink::WebString::fromUTF8("Referer"))), | 455 request.httpHeaderField(blink::WebString::fromUTF8("Referer"))), |
| 456 request.referrerPolicy()); | 456 request.referrerPolicy()); |
| 457 params.disposition = CURRENT_TAB; | 457 params.disposition = CURRENT_TAB; |
| 458 params.should_replace_current_entry = should_replace_current_entry; | 458 params.should_replace_current_entry = should_replace_current_entry; |
| 459 params.user_gesture = | 459 params.user_gesture = |
| 460 blink::WebUserGestureIndicator::isProcessingUserGesture(); | 460 blink::WebUserGestureIndicator::isProcessingUserGesture(); |
| 461 blink::WebUserGestureIndicator::consumeUserGesture(); | 461 blink::WebUserGestureIndicator::consumeUserGesture(); |
| 462 Send(new FrameHostMsg_OpenURL(routing_id_, params)); | 462 Send(new FrameHostMsg_OpenURL(routing_id_, params)); |
| 463 } | 463 } |
| 464 | 464 |
| 465 void RenderFrameProxy::forwardInputEvent(const blink::WebInputEvent* event) { | 465 void RenderFrameProxy::forwardInputEvent(const blink::WebInputEvent* event) { |
| 466 Send(new FrameHostMsg_ForwardInputEvent(routing_id_, event)); | 466 Send(new FrameHostMsg_ForwardInputEvent(routing_id_, event)); |
| 467 } | 467 } |
| 468 | 468 |
| 469 void RenderFrameProxy::frameRectsChanged(const blink::WebRect& frame_rect) { | 469 void RenderFrameProxy::frameRectsChanged(const blink::WebRect& frame_rect) { |
| 470 Send(new FrameHostMsg_FrameRectChanged(routing_id_, frame_rect)); | 470 gfx::Rect rect = frame_rect; |
| 471 if (IsUseZoomForDSFEnabled()) { | |
| 472 rect = gfx::ScaleToEnclosingRect( | |
| 473 rect, 1.f / render_widget_->GetOriginalDeviceScaleFactor()); | |
|
oshima
2016/08/17 00:17:04
We probably should update the RenderWIdget::conver
lfg
2016/08/17 15:37:51
I'll put up another CL to update that.
| |
| 474 } | |
| 475 Send(new FrameHostMsg_FrameRectChanged(routing_id_, rect)); | |
| 471 } | 476 } |
| 472 | 477 |
| 473 void RenderFrameProxy::visibilityChanged(bool visible) { | 478 void RenderFrameProxy::visibilityChanged(bool visible) { |
| 474 Send(new FrameHostMsg_VisibilityChanged(routing_id_, visible)); | 479 Send(new FrameHostMsg_VisibilityChanged(routing_id_, visible)); |
| 475 } | 480 } |
| 476 | 481 |
| 477 void RenderFrameProxy::didChangeOpener(blink::WebFrame* opener) { | 482 void RenderFrameProxy::didChangeOpener(blink::WebFrame* opener) { |
| 478 // A proxy shouldn't normally be disowning its opener. It is possible to get | 483 // A proxy shouldn't normally be disowning its opener. It is possible to get |
| 479 // here when a proxy that is being detached clears its opener, in which case | 484 // here when a proxy that is being detached clears its opener, in which case |
| 480 // there is no need to notify the browser process. | 485 // there is no need to notify the browser process. |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 494 blink::WebLocalFrame* source) { | 499 blink::WebLocalFrame* source) { |
| 495 int source_routing_id = RenderFrameImpl::FromWebFrame(source)->GetRoutingID(); | 500 int source_routing_id = RenderFrameImpl::FromWebFrame(source)->GetRoutingID(); |
| 496 Send(new FrameHostMsg_AdvanceFocus(routing_id_, type, source_routing_id)); | 501 Send(new FrameHostMsg_AdvanceFocus(routing_id_, type, source_routing_id)); |
| 497 } | 502 } |
| 498 | 503 |
| 499 void RenderFrameProxy::frameFocused() { | 504 void RenderFrameProxy::frameFocused() { |
| 500 Send(new FrameHostMsg_FrameFocused(routing_id_)); | 505 Send(new FrameHostMsg_FrameFocused(routing_id_)); |
| 501 } | 506 } |
| 502 | 507 |
| 503 } // namespace | 508 } // namespace |
| OLD | NEW |