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

Side by Side Diff: content/browser/frame_host/frame_tree_node.h

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, 3 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 unified diff | Download patch
OLDNEW
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
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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 142
141 bool HasSameOrigin(const FrameTreeNode& node) const { 143 bool HasSameOrigin(const FrameTreeNode& node) const {
142 return replication_state_.origin.IsSameOriginWith( 144 return replication_state_.origin.IsSameOriginWith(
143 node.replication_state_.origin); 145 node.replication_state_.origin);
144 } 146 }
145 147
146 const FrameReplicationState& current_replication_state() const { 148 const FrameReplicationState& current_replication_state() const {
147 return replication_state_; 149 return replication_state_;
148 } 150 }
149 151
152 const blink::WebFrameOwnerProperties& frame_owner_properties() {
153 return frame_owner_properties_;
154 }
155
156 void SetScrollingMode(blink::WebFrameOwnerProperties::ScrollingMode mode);
157 void SetMarginWidth(int margin_width);
158 void SetMarginHeight(int margin_height);
159
150 RenderFrameHostImpl* current_frame_host() const { 160 RenderFrameHostImpl* current_frame_host() const {
151 return render_manager_.current_frame_host(); 161 return render_manager_.current_frame_host();
152 } 162 }
153 163
154 bool IsDescendantOf(FrameTreeNode* other) const; 164 bool IsDescendantOf(FrameTreeNode* other) const;
155 165
156 // Return the node immediately preceding this node in its parent's 166 // Return the node immediately preceding this node in its parent's
157 // |children_|, or nullptr if there is no such node. 167 // |children_|, or nullptr if there is no such node.
158 FrameTreeNode* PreviousSibling() const; 168 FrameTreeNode* PreviousSibling() const;
159 169
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 // Track the effective sandbox flags for this frame. When a parent frame 279 // 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 280 // dynamically updates sandbox flags for a child frame, the child's updated
271 // sandbox flags are stored in replication_state_.sandbox_flags. However, the 281 // sandbox flags are stored in replication_state_.sandbox_flags. However, the
272 // update only takes effect on the next frame navigation, so the effective 282 // update only takes effect on the next frame navigation, so the effective
273 // sandbox flags are tracked separately here. When enforcing sandbox flags 283 // sandbox flags are tracked separately here. When enforcing sandbox flags
274 // directives in the browser process, |effective_sandbox_flags_| should be 284 // directives in the browser process, |effective_sandbox_flags_| should be
275 // used. |effective_sandbox_flags_| is updated with any pending sandbox 285 // used. |effective_sandbox_flags_| is updated with any pending sandbox
276 // flags when a navigation for this frame commits. 286 // flags when a navigation for this frame commits.
277 blink::WebSandboxFlags effective_sandbox_flags_; 287 blink::WebSandboxFlags effective_sandbox_flags_;
278 288
289 // Tracks the scrolling and margin properties for this frame. These
290 // properties affect the child renderer but are available on its parent's
291 // frame element. When a parent frame dynamically updates these properties,
292 // we store it here. However, the update only takes effect on the next frame
293 // navigation.
alexmos 2015/09/02 21:42:09 It sounds like taking effect on next navigation is
lazyboy 2015/09/15 19:30:56 Added TODO.
294 blink::WebFrameOwnerProperties frame_owner_properties_;
295
279 // Used to track this node's loading progress (from 0 to 1). 296 // Used to track this node's loading progress (from 0 to 1).
280 double loading_progress_; 297 double loading_progress_;
281 298
282 // PlzNavigate 299 // PlzNavigate
283 // Owns an ongoing NavigationRequest until it is ready to commit. It will then 300 // 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. 301 // be reset and a RenderFrameHost will be responsible for the navigation.
285 scoped_ptr<NavigationRequest> navigation_request_; 302 scoped_ptr<NavigationRequest> navigation_request_;
286 303
287 // List of objects observing this FrameTreeNode. 304 // List of objects observing this FrameTreeNode.
288 base::ObserverList<Observer> observers_; 305 base::ObserverList<Observer> observers_;
289 306
290 base::TimeTicks last_focus_time_; 307 base::TimeTicks last_focus_time_;
291 308
292 DISALLOW_COPY_AND_ASSIGN(FrameTreeNode); 309 DISALLOW_COPY_AND_ASSIGN(FrameTreeNode);
293 }; 310 };
294 311
295 } // namespace content 312 } // namespace content
296 313
297 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ 314 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698