| 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 |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 } | 222 } |
| 223 | 223 |
| 224 void RenderFrameProxy::SetReplicatedState(const FrameReplicationState& state) { | 224 void RenderFrameProxy::SetReplicatedState(const FrameReplicationState& state) { |
| 225 DCHECK(web_frame_); | 225 DCHECK(web_frame_); |
| 226 web_frame_->setReplicatedOrigin(state.origin); | 226 web_frame_->setReplicatedOrigin(state.origin); |
| 227 web_frame_->setReplicatedSandboxFlags(state.sandbox_flags); | 227 web_frame_->setReplicatedSandboxFlags(state.sandbox_flags); |
| 228 web_frame_->setReplicatedName(blink::WebString::fromUTF8(state.name), | 228 web_frame_->setReplicatedName(blink::WebString::fromUTF8(state.name), |
| 229 blink::WebString::fromUTF8(state.unique_name)); | 229 blink::WebString::fromUTF8(state.unique_name)); |
| 230 web_frame_->setReplicatedShouldEnforceStrictMixedContentChecking( | 230 web_frame_->setReplicatedShouldEnforceStrictMixedContentChecking( |
| 231 state.should_enforce_strict_mixed_content_checking); | 231 state.should_enforce_strict_mixed_content_checking); |
| 232 web_frame_->setReplicatedPotentiallyTrustworthyUniqueOrigin( |
| 233 state.has_potentially_trustworthy_unique_origin); |
| 232 } | 234 } |
| 233 | 235 |
| 234 // Update the proxy's SecurityContext and FrameOwner with new sandbox flags | 236 // Update the proxy's SecurityContext and FrameOwner with new sandbox flags |
| 235 // that were set by its parent in another process. | 237 // that were set by its parent in another process. |
| 236 // | 238 // |
| 237 // Normally, when a frame's sandbox attribute is changed dynamically, the | 239 // Normally, when a frame's sandbox attribute is changed dynamically, the |
| 238 // frame's FrameOwner is updated with the new sandbox flags right away, while | 240 // frame's FrameOwner is updated with the new sandbox flags right away, while |
| 239 // the frame's SecurityContext is updated when the frame is navigated and the | 241 // the frame's SecurityContext is updated when the frame is navigated and the |
| 240 // new sandbox flags take effect. | 242 // new sandbox flags take effect. |
| 241 // | 243 // |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 web_frame_->setReplicatedName(blink::WebString::fromUTF8(name), | 361 web_frame_->setReplicatedName(blink::WebString::fromUTF8(name), |
| 360 blink::WebString::fromUTF8(unique_name)); | 362 blink::WebString::fromUTF8(unique_name)); |
| 361 } | 363 } |
| 362 | 364 |
| 363 void RenderFrameProxy::OnEnforceStrictMixedContentChecking( | 365 void RenderFrameProxy::OnEnforceStrictMixedContentChecking( |
| 364 bool should_enforce) { | 366 bool should_enforce) { |
| 365 web_frame_->setReplicatedShouldEnforceStrictMixedContentChecking( | 367 web_frame_->setReplicatedShouldEnforceStrictMixedContentChecking( |
| 366 should_enforce); | 368 should_enforce); |
| 367 } | 369 } |
| 368 | 370 |
| 369 void RenderFrameProxy::OnDidUpdateOrigin(const url::Origin& origin) { | 371 void RenderFrameProxy::OnDidUpdateOrigin( |
| 372 const url::Origin& origin, |
| 373 bool is_potentially_trustworthy_unique_origin) { |
| 370 web_frame_->setReplicatedOrigin(origin); | 374 web_frame_->setReplicatedOrigin(origin); |
| 375 web_frame_->setReplicatedPotentiallyTrustworthyUniqueOrigin( |
| 376 is_potentially_trustworthy_unique_origin); |
| 371 } | 377 } |
| 372 | 378 |
| 373 void RenderFrameProxy::OnSetPageFocus(bool is_focused) { | 379 void RenderFrameProxy::OnSetPageFocus(bool is_focused) { |
| 374 render_view_->SetFocus(is_focused); | 380 render_view_->SetFocus(is_focused); |
| 375 } | 381 } |
| 376 | 382 |
| 377 void RenderFrameProxy::OnSetFocusedFrame() { | 383 void RenderFrameProxy::OnSetFocusedFrame() { |
| 378 // This uses focusDocumentView rather than setFocusedFrame so that blur | 384 // This uses focusDocumentView rather than setFocusedFrame so that blur |
| 379 // events are properly dispatched on any currently focused elements. | 385 // events are properly dispatched on any currently focused elements. |
| 380 render_view_->webview()->focusDocumentView(web_frame_); | 386 render_view_->webview()->focusDocumentView(web_frame_); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 blink::WebLocalFrame* source) { | 495 blink::WebLocalFrame* source) { |
| 490 int source_routing_id = RenderFrameImpl::FromWebFrame(source)->GetRoutingID(); | 496 int source_routing_id = RenderFrameImpl::FromWebFrame(source)->GetRoutingID(); |
| 491 Send(new FrameHostMsg_AdvanceFocus(routing_id_, type, source_routing_id)); | 497 Send(new FrameHostMsg_AdvanceFocus(routing_id_, type, source_routing_id)); |
| 492 } | 498 } |
| 493 | 499 |
| 494 void RenderFrameProxy::frameFocused() { | 500 void RenderFrameProxy::frameFocused() { |
| 495 Send(new FrameHostMsg_FrameFocused(routing_id_)); | 501 Send(new FrameHostMsg_FrameFocused(routing_id_)); |
| 496 } | 502 } |
| 497 | 503 |
| 498 } // namespace | 504 } // namespace |
| OLD | NEW |