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 #include "content/browser/frame_host/frame_tree_node.h" | 5 #include "content/browser/frame_host/frame_tree_node.h" |
6 | 6 |
7 #include <queue> | 7 #include <queue> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 render_frame_delegate, | 99 render_frame_delegate, |
100 render_widget_delegate, | 100 render_widget_delegate, |
101 manager_delegate), | 101 manager_delegate), |
102 frame_tree_node_id_(next_frame_tree_node_id_++), | 102 frame_tree_node_id_(next_frame_tree_node_id_++), |
103 parent_(parent), | 103 parent_(parent), |
104 opener_(nullptr), | 104 opener_(nullptr), |
105 opener_observer_(nullptr), | 105 opener_observer_(nullptr), |
106 original_opener_(nullptr), | 106 original_opener_(nullptr), |
107 original_opener_observer_(nullptr), | 107 original_opener_observer_(nullptr), |
108 has_committed_real_load_(false), | 108 has_committed_real_load_(false), |
| 109 is_collapsed_(false), |
109 replication_state_( | 110 replication_state_( |
110 scope, | 111 scope, |
111 name, | 112 name, |
112 unique_name, | 113 unique_name, |
113 blink::WebSandboxFlags::kNone, | 114 blink::WebSandboxFlags::kNone, |
114 false /* should enforce strict mixed content checking */, | 115 false /* should enforce strict mixed content checking */, |
115 false /* is a potentially trustworthy unique origin */, | 116 false /* is a potentially trustworthy unique origin */, |
116 false /* has received a user gesture */), | 117 false /* has received a user gesture */), |
117 pending_sandbox_flags_(blink::WebSandboxFlags::kNone), | 118 pending_sandbox_flags_(blink::WebSandboxFlags::kNone), |
118 frame_owner_properties_(frame_owner_properties), | 119 frame_owner_properties_(frame_owner_properties), |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 replication_state_.has_potentially_trustworthy_unique_origin != | 254 replication_state_.has_potentially_trustworthy_unique_origin != |
254 is_potentially_trustworthy_unique_origin) { | 255 is_potentially_trustworthy_unique_origin) { |
255 render_manager_.OnDidUpdateOrigin(origin, | 256 render_manager_.OnDidUpdateOrigin(origin, |
256 is_potentially_trustworthy_unique_origin); | 257 is_potentially_trustworthy_unique_origin); |
257 } | 258 } |
258 replication_state_.origin = origin; | 259 replication_state_.origin = origin; |
259 replication_state_.has_potentially_trustworthy_unique_origin = | 260 replication_state_.has_potentially_trustworthy_unique_origin = |
260 is_potentially_trustworthy_unique_origin; | 261 is_potentially_trustworthy_unique_origin; |
261 } | 262 } |
262 | 263 |
| 264 void FrameTreeNode::SetCollapsed(bool collapsed) { |
| 265 DCHECK(!IsMainFrame()); |
| 266 if (is_collapsed_ == collapsed) |
| 267 return; |
| 268 |
| 269 is_collapsed_ = collapsed; |
| 270 render_manager_.OnDidChangeCollapsedState(collapsed); |
| 271 } |
| 272 |
263 void FrameTreeNode::SetFrameName(const std::string& name, | 273 void FrameTreeNode::SetFrameName(const std::string& name, |
264 const std::string& unique_name) { | 274 const std::string& unique_name) { |
265 if (name == replication_state_.name) { | 275 if (name == replication_state_.name) { |
266 // |unique_name| shouldn't change unless |name| changes. | 276 // |unique_name| shouldn't change unless |name| changes. |
267 DCHECK_EQ(unique_name, replication_state_.unique_name); | 277 DCHECK_EQ(unique_name, replication_state_.unique_name); |
268 return; | 278 return; |
269 } | 279 } |
270 | 280 |
271 if (parent()) { | 281 if (parent()) { |
272 // Non-main frames should have a non-empty unique name. | 282 // Non-main frames should have a non-empty unique name. |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 } | 576 } |
567 return parent_->child_at(i + relative_offset); | 577 return parent_->child_at(i + relative_offset); |
568 } | 578 } |
569 } | 579 } |
570 | 580 |
571 NOTREACHED() << "FrameTreeNode not found in its parent's children."; | 581 NOTREACHED() << "FrameTreeNode not found in its parent's children."; |
572 return nullptr; | 582 return nullptr; |
573 } | 583 } |
574 | 584 |
575 } // namespace content | 585 } // namespace content |
OLD | NEW |