OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ |
6 #define CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/scoped_vector.h" | 13 #include "base/memory/scoped_vector.h" |
14 #include "content/browser/frame_host/render_frame_host_impl.h" | 14 #include "content/browser/frame_host/render_frame_host_impl.h" |
15 #include "content/browser/frame_host/render_frame_host_manager.h" | 15 #include "content/browser/frame_host/render_frame_host_manager.h" |
16 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
17 #include "content/common/frame_replication_state.h" | 17 #include "content/common/frame_replication_state.h" |
| 18 #include "third_party/WebKit/public/web/WebFrameOwnerProperties.h" |
18 #include "url/gurl.h" | 19 #include "url/gurl.h" |
19 #include "url/origin.h" | 20 #include "url/origin.h" |
20 | 21 |
21 namespace content { | 22 namespace content { |
22 | 23 |
23 class FrameTree; | 24 class FrameTree; |
24 class NavigationRequest; | 25 class NavigationRequest; |
25 class Navigator; | 26 class Navigator; |
26 class RenderFrameHostImpl; | 27 class RenderFrameHostImpl; |
27 | 28 |
(...skipping 18 matching lines...) Expand all Loading... |
46 static FrameTreeNode* GloballyFindByID(int frame_tree_node_id); | 47 static FrameTreeNode* GloballyFindByID(int frame_tree_node_id); |
47 | 48 |
48 FrameTreeNode(FrameTree* frame_tree, | 49 FrameTreeNode(FrameTree* frame_tree, |
49 Navigator* navigator, | 50 Navigator* navigator, |
50 RenderFrameHostDelegate* render_frame_delegate, | 51 RenderFrameHostDelegate* render_frame_delegate, |
51 RenderViewHostDelegate* render_view_delegate, | 52 RenderViewHostDelegate* render_view_delegate, |
52 RenderWidgetHostDelegate* render_widget_delegate, | 53 RenderWidgetHostDelegate* render_widget_delegate, |
53 RenderFrameHostManager::Delegate* manager_delegate, | 54 RenderFrameHostManager::Delegate* manager_delegate, |
54 blink::WebTreeScopeType scope, | 55 blink::WebTreeScopeType scope, |
55 const std::string& name, | 56 const std::string& name, |
56 blink::WebSandboxFlags sandbox_flags); | 57 blink::WebSandboxFlags sandbox_flags, |
| 58 const blink::WebFrameOwnerProperties& frame_owner_properties); |
57 | 59 |
58 ~FrameTreeNode(); | 60 ~FrameTreeNode(); |
59 | 61 |
60 void AddObserver(Observer* observer); | 62 void AddObserver(Observer* observer); |
61 void RemoveObserver(Observer* observer); | 63 void RemoveObserver(Observer* observer); |
62 | 64 |
63 bool IsMainFrame() const; | 65 bool IsMainFrame() const; |
64 | 66 |
65 void AddChild(scoped_ptr<FrameTreeNode> child, | 67 void AddChild(scoped_ptr<FrameTreeNode> child, |
66 int process_id, | 68 int process_id, |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 } | 133 } |
132 | 134 |
133 void set_sandbox_flags(blink::WebSandboxFlags sandbox_flags) { | 135 void set_sandbox_flags(blink::WebSandboxFlags sandbox_flags) { |
134 replication_state_.sandbox_flags = sandbox_flags; | 136 replication_state_.sandbox_flags = sandbox_flags; |
135 } | 137 } |
136 | 138 |
137 // Transfer any pending sandbox flags into |effective_sandbox_flags_|, and | 139 // Transfer any pending sandbox flags into |effective_sandbox_flags_|, and |
138 // return true if the sandbox flags were changed. | 140 // return true if the sandbox flags were changed. |
139 bool CommitPendingSandboxFlags(); | 141 bool CommitPendingSandboxFlags(); |
140 | 142 |
| 143 const blink::WebFrameOwnerProperties& frame_owner_properties() { |
| 144 return frame_owner_properties_; |
| 145 } |
| 146 |
| 147 void set_frame_owner_properties( |
| 148 const blink::WebFrameOwnerProperties& frame_owner_properties) { |
| 149 frame_owner_properties_ = frame_owner_properties; |
| 150 } |
| 151 |
141 bool HasSameOrigin(const FrameTreeNode& node) const { | 152 bool HasSameOrigin(const FrameTreeNode& node) const { |
142 return replication_state_.origin.IsSameOriginWith( | 153 return replication_state_.origin.IsSameOriginWith( |
143 node.replication_state_.origin); | 154 node.replication_state_.origin); |
144 } | 155 } |
145 | 156 |
146 const FrameReplicationState& current_replication_state() const { | 157 const FrameReplicationState& current_replication_state() const { |
147 return replication_state_; | 158 return replication_state_; |
148 } | 159 } |
149 | 160 |
150 RenderFrameHostImpl* current_frame_host() const { | 161 RenderFrameHostImpl* current_frame_host() const { |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 // Track the effective sandbox flags for this frame. When a parent frame | 280 // Track the effective sandbox flags for this frame. When a parent frame |
270 // dynamically updates sandbox flags for a child frame, the child's updated | 281 // dynamically updates sandbox flags for a child frame, the child's updated |
271 // sandbox flags are stored in replication_state_.sandbox_flags. However, the | 282 // sandbox flags are stored in replication_state_.sandbox_flags. However, the |
272 // update only takes effect on the next frame navigation, so the effective | 283 // update only takes effect on the next frame navigation, so the effective |
273 // sandbox flags are tracked separately here. When enforcing sandbox flags | 284 // sandbox flags are tracked separately here. When enforcing sandbox flags |
274 // directives in the browser process, |effective_sandbox_flags_| should be | 285 // directives in the browser process, |effective_sandbox_flags_| should be |
275 // used. |effective_sandbox_flags_| is updated with any pending sandbox | 286 // used. |effective_sandbox_flags_| is updated with any pending sandbox |
276 // flags when a navigation for this frame commits. | 287 // flags when a navigation for this frame commits. |
277 blink::WebSandboxFlags effective_sandbox_flags_; | 288 blink::WebSandboxFlags effective_sandbox_flags_; |
278 | 289 |
| 290 // Tracks the scrolling and margin properties for this frame. These |
| 291 // properties affect the child renderer but are stored on its parent's |
| 292 // frame element. When this frame's parent dynamically updates these |
| 293 // properties, we update them here too. |
| 294 // |
| 295 // Note that dynamic updates only take effect on the next frame navigation. |
| 296 blink::WebFrameOwnerProperties frame_owner_properties_; |
| 297 |
279 // Used to track this node's loading progress (from 0 to 1). | 298 // Used to track this node's loading progress (from 0 to 1). |
280 double loading_progress_; | 299 double loading_progress_; |
281 | 300 |
282 // PlzNavigate | 301 // PlzNavigate |
283 // Owns an ongoing NavigationRequest until it is ready to commit. It will then | 302 // Owns an ongoing NavigationRequest until it is ready to commit. It will then |
284 // be reset and a RenderFrameHost will be responsible for the navigation. | 303 // be reset and a RenderFrameHost will be responsible for the navigation. |
285 scoped_ptr<NavigationRequest> navigation_request_; | 304 scoped_ptr<NavigationRequest> navigation_request_; |
286 | 305 |
287 // List of objects observing this FrameTreeNode. | 306 // List of objects observing this FrameTreeNode. |
288 base::ObserverList<Observer> observers_; | 307 base::ObserverList<Observer> observers_; |
289 | 308 |
290 base::TimeTicks last_focus_time_; | 309 base::TimeTicks last_focus_time_; |
291 | 310 |
292 DISALLOW_COPY_AND_ASSIGN(FrameTreeNode); | 311 DISALLOW_COPY_AND_ASSIGN(FrameTreeNode); |
293 }; | 312 }; |
294 | 313 |
295 } // namespace content | 314 } // namespace content |
296 | 315 |
297 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ | 316 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ |
OLD | NEW |