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

Unified Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 1307013004: Propagate scrolling/marginwidth/marginheight property values to child frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove dep patch Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/frame_host/render_frame_host_impl.cc
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index d446d14a02cecc33b2bfca5ab705ebb44fbe1a0a..1c26e31ca91d9041f6ef2ae11bbe973e0305c922 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -456,6 +456,12 @@ bool RenderFrameHostImpl::OnMessageReceived(const IPC::Message &msg) {
IPC_MESSAGE_HANDLER(FrameHostMsg_DidAssignPageId, OnDidAssignPageId)
IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeSandboxFlags,
OnDidChangeSandboxFlags)
+ IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeScrollingMode,
+ OnDidChangeScrollingMode)
+ IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeMarginWidth,
+ OnDidChangeMarginWidth)
+ IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeMarginHeight,
+ OnDidChangeMarginHeight)
IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateTitle, OnUpdateTitle)
IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateEncoding, OnUpdateEncoding)
IPC_MESSAGE_HANDLER(FrameHostMsg_BeginNavigation,
@@ -619,6 +625,7 @@ bool RenderFrameHostImpl::CreateRenderFrame(int parent_routing_id,
params.proxy_routing_id = proxy_routing_id;
params.previous_sibling_routing_id = previous_sibling_routing_id;
params.replication_state = frame_tree_node()->current_replication_state();
+ params.frame_owner_properties = frame_tree_node()->frame_owner_properties();
if (render_widget_host_) {
params.widget_params.routing_id = render_widget_host_->GetRoutingID();
@@ -710,7 +717,8 @@ void RenderFrameHostImpl::OnCreateChildFrame(
int new_routing_id,
blink::WebTreeScopeType scope,
const std::string& frame_name,
- blink::WebSandboxFlags sandbox_flags) {
+ blink::WebSandboxFlags sandbox_flags,
+ const blink::WebFrameOwnerProperties& frame_owner_properties) {
// It is possible that while a new RenderFrameHost was committed, the
// RenderFrame corresponding to this host sent an IPC message to create a
// frame and it is delivered after this host is swapped out.
@@ -718,9 +726,9 @@ void RenderFrameHostImpl::OnCreateChildFrame(
if (rfh_state_ != RenderFrameHostImpl::STATE_DEFAULT)
return;
- RenderFrameHostImpl* new_frame =
- frame_tree_->AddFrame(frame_tree_node_, GetProcess()->GetID(),
- new_routing_id, scope, frame_name, sandbox_flags);
+ RenderFrameHostImpl* new_frame = frame_tree_->AddFrame(
+ frame_tree_node_, GetProcess()->GetID(), new_routing_id, scope,
+ frame_name, sandbox_flags, frame_owner_properties);
if (!new_frame)
return;
@@ -1313,6 +1321,40 @@ void RenderFrameHostImpl::OnDidChangeSandboxFlags(
}
}
+void RenderFrameHostImpl::OnDidChangeScrollingMode(
+ int32 frame_routing_id,
+ blink::WebFrameOwnerProperties::ScrollingMode mode) {
+ FrameTree* frame_tree = frame_tree_node()->frame_tree();
+ FrameTreeNode* child =
+ frame_tree->FindByRoutingID(GetProcess()->GetID(), frame_routing_id);
+ if (!child)
+ return;
+
alexmos 2015/09/02 21:42:09 How about adding a security check here that it's t
lazyboy 2015/09/15 19:30:56 Done.
+ child->SetScrollingMode(mode);
+}
+
+void RenderFrameHostImpl::OnDidChangeMarginWidth(int32 frame_routing_id,
+ int new_margin_width) {
+ FrameTree* frame_tree = frame_tree_node()->frame_tree();
+ FrameTreeNode* child =
+ frame_tree->FindByRoutingID(GetProcess()->GetID(), frame_routing_id);
+ if (!child)
+ return;
+
+ child->SetMarginWidth(new_margin_width);
+}
+
+void RenderFrameHostImpl::OnDidChangeMarginHeight(int32 frame_routing_id,
+ int new_margin_height) {
+ FrameTree* frame_tree = frame_tree_node()->frame_tree();
+ FrameTreeNode* child =
+ frame_tree->FindByRoutingID(GetProcess()->GetID(), frame_routing_id);
+ if (!child)
+ return;
+
+ child->SetMarginHeight(new_margin_height);
+}
+
void RenderFrameHostImpl::OnUpdateTitle(
const base::string16& title,
blink::WebTextDirection title_direction) {

Powered by Google App Engine
This is Rietveld 408576698