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 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/profiler/scoped_tracker.h" | 10 #include "base/profiler/scoped_tracker.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 render_manager_(this, | 83 render_manager_(this, |
84 render_frame_delegate, | 84 render_frame_delegate, |
85 render_view_delegate, | 85 render_view_delegate, |
86 render_widget_delegate, | 86 render_widget_delegate, |
87 manager_delegate), | 87 manager_delegate), |
88 frame_tree_node_id_(next_frame_tree_node_id_++), | 88 frame_tree_node_id_(next_frame_tree_node_id_++), |
89 parent_(NULL), | 89 parent_(NULL), |
90 opener_(nullptr), | 90 opener_(nullptr), |
91 opener_observer_(nullptr), | 91 opener_observer_(nullptr), |
92 has_committed_real_load_(false), | 92 has_committed_real_load_(false), |
93 replication_state_(scope, name, sandbox_flags), | 93 replication_state_( |
| 94 scope, |
| 95 name, |
| 96 sandbox_flags, |
| 97 false /* should enforce strict mixed content checking */), |
94 // Effective sandbox flags also need to be set, since initial sandbox | 98 // Effective sandbox flags also need to be set, since initial sandbox |
95 // flags should apply to the initial empty document in the frame. | 99 // flags should apply to the initial empty document in the frame. |
96 effective_sandbox_flags_(sandbox_flags), | 100 effective_sandbox_flags_(sandbox_flags), |
97 frame_owner_properties_(frame_owner_properties), | 101 frame_owner_properties_(frame_owner_properties), |
98 loading_progress_(kLoadingProgressNotStarted) { | 102 loading_progress_(kLoadingProgressNotStarted) { |
99 std::pair<FrameTreeNodeIDMap::iterator, bool> result = | 103 std::pair<FrameTreeNodeIDMap::iterator, bool> result = |
100 g_frame_tree_node_id_map.Get().insert( | 104 g_frame_tree_node_id_map.Get().insert( |
101 std::make_pair(frame_tree_node_id_, this)); | 105 std::make_pair(frame_tree_node_id_, this)); |
102 CHECK(result.second); | 106 CHECK(result.second); |
103 } | 107 } |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 render_manager_.OnDidUpdateOrigin(origin); | 201 render_manager_.OnDidUpdateOrigin(origin); |
198 replication_state_.origin = origin; | 202 replication_state_.origin = origin; |
199 } | 203 } |
200 | 204 |
201 void FrameTreeNode::SetFrameName(const std::string& name) { | 205 void FrameTreeNode::SetFrameName(const std::string& name) { |
202 if (name != replication_state_.name) | 206 if (name != replication_state_.name) |
203 render_manager_.OnDidUpdateName(name); | 207 render_manager_.OnDidUpdateName(name); |
204 replication_state_.name = name; | 208 replication_state_.name = name; |
205 } | 209 } |
206 | 210 |
| 211 void FrameTreeNode::SetEnforceStrictMixedContentChecking(bool should_enforce) { |
| 212 if (should_enforce == |
| 213 replication_state_.should_enforce_strict_mixed_content_checking) { |
| 214 return; |
| 215 } |
| 216 render_manager_.OnEnforceStrictMixedContentChecking(should_enforce); |
| 217 replication_state_.should_enforce_strict_mixed_content_checking = |
| 218 should_enforce; |
| 219 } |
| 220 |
207 bool FrameTreeNode::IsDescendantOf(FrameTreeNode* other) const { | 221 bool FrameTreeNode::IsDescendantOf(FrameTreeNode* other) const { |
208 if (!other || !other->child_count()) | 222 if (!other || !other->child_count()) |
209 return false; | 223 return false; |
210 | 224 |
211 for (FrameTreeNode* node = parent(); node; node = node->parent()) { | 225 for (FrameTreeNode* node = parent(); node; node = node->parent()) { |
212 if (node == other) | 226 if (node == other) |
213 return true; | 227 return true; |
214 } | 228 } |
215 | 229 |
216 return false; | 230 return false; |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 render_manager_.Stop(); | 394 render_manager_.Stop(); |
381 return true; | 395 return true; |
382 } | 396 } |
383 | 397 |
384 void FrameTreeNode::DidFocus() { | 398 void FrameTreeNode::DidFocus() { |
385 last_focus_time_ = base::TimeTicks::Now(); | 399 last_focus_time_ = base::TimeTicks::Now(); |
386 FOR_EACH_OBSERVER(Observer, observers_, OnFrameTreeNodeFocused(this)); | 400 FOR_EACH_OBSERVER(Observer, observers_, OnFrameTreeNodeFocused(this)); |
387 } | 401 } |
388 | 402 |
389 } // namespace content | 403 } // namespace content |
OLD | NEW |