| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/html_viewer/replicated_frame_state.h" | 5 #include "components/html_viewer/replicated_frame_state.h" |
| 6 | 6 |
| 7 #include "components/html_viewer/html_frame_properties.h" | 7 #include "components/html_viewer/html_frame_properties.h" |
| 8 | 8 |
| 9 namespace html_viewer { | 9 namespace html_viewer { |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 if (!FrameSandboxFlagsFromClientProperty( | 24 if (!FrameSandboxFlagsFromClientProperty( |
| 25 GetValueFromClientProperties(kPropertyFrameSandboxFlags, properties), | 25 GetValueFromClientProperties(kPropertyFrameSandboxFlags, properties), |
| 26 &(state->sandbox_flags))) { | 26 &(state->sandbox_flags))) { |
| 27 state->sandbox_flags = blink::WebSandboxFlags::None; | 27 state->sandbox_flags = blink::WebSandboxFlags::None; |
| 28 } | 28 } |
| 29 if (!FrameTreeScopeFromClientProperty( | 29 if (!FrameTreeScopeFromClientProperty( |
| 30 GetValueFromClientProperties(kPropertyFrameTreeScope, properties), | 30 GetValueFromClientProperties(kPropertyFrameTreeScope, properties), |
| 31 &(state->tree_scope))) { | 31 &(state->tree_scope))) { |
| 32 state->tree_scope = blink::WebTreeScopeType::Document; | 32 state->tree_scope = blink::WebTreeScopeType::Document; |
| 33 } | 33 } |
| 34 if (!FrameOwnerPropertiesFromClientProperty( |
| 35 GetValueFromClientProperties(kPropertyFrameOwnerProperties, |
| 36 properties), |
| 37 &(state->owner_properties))) { |
| 38 state->owner_properties = blink::WebFrameOwnerProperties(); |
| 39 } |
| 34 } | 40 } |
| 35 | 41 |
| 36 void ClientPropertiesFromReplicatedFrameState( | 42 void ClientPropertiesFromReplicatedFrameState( |
| 37 const ReplicatedFrameState& state, | 43 const ReplicatedFrameState& state, |
| 38 mojo::Map<mojo::String, mojo::Array<uint8_t>>* properties) { | 44 mojo::Map<mojo::String, mojo::Array<uint8_t>>* properties) { |
| 39 AddToClientPropertiesIfValid(kPropertyFrameName, | 45 AddToClientPropertiesIfValid(kPropertyFrameName, |
| 40 FrameNameToClientProperty(state.name).Pass(), | 46 FrameNameToClientProperty(state.name).Pass(), |
| 41 properties); | 47 properties); |
| 42 AddToClientPropertiesIfValid( | 48 AddToClientPropertiesIfValid( |
| 43 kPropertyFrameTreeScope, | 49 kPropertyFrameTreeScope, |
| 44 FrameTreeScopeToClientProperty(state.tree_scope).Pass(), properties); | 50 FrameTreeScopeToClientProperty(state.tree_scope).Pass(), properties); |
| 45 AddToClientPropertiesIfValid( | 51 AddToClientPropertiesIfValid( |
| 46 kPropertyFrameSandboxFlags, | 52 kPropertyFrameSandboxFlags, |
| 47 FrameSandboxFlagsToClientProperty(state.sandbox_flags).Pass(), | 53 FrameSandboxFlagsToClientProperty(state.sandbox_flags).Pass(), |
| 48 properties); | 54 properties); |
| 55 AddToClientPropertiesIfValid( |
| 56 kPropertyFrameOwnerProperties, |
| 57 FrameOwnerPropertiesToClientProperty(state.owner_properties).Pass(), |
| 58 properties); |
| 49 } | 59 } |
| 50 | 60 |
| 51 } // namespace html_viewer | 61 } // namespace html_viewer |
| OLD | NEW |