OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 /* | 5 /* |
6 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 6 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
10 * | 10 * |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 RenderFrameImpl* current_frame) { | 62 RenderFrameImpl* current_frame) { |
63 bool is_target_frame = target_frame == current_frame; | 63 bool is_target_frame = target_frame == current_frame; |
64 const WebHistoryItem& item_for_create = is_target_frame ? new_item : item_; | 64 const WebHistoryItem& item_for_create = is_target_frame ? new_item : item_; |
65 HistoryNode* new_history_node = new HistoryNode(new_entry, item_for_create); | 65 HistoryNode* new_history_node = new HistoryNode(new_entry, item_for_create); |
66 | 66 |
67 if (is_target_frame && clone_children_of_target && !item_.isNull()) { | 67 if (is_target_frame && clone_children_of_target && !item_.isNull()) { |
68 new_history_node->item().setDocumentSequenceNumber( | 68 new_history_node->item().setDocumentSequenceNumber( |
69 item_.documentSequenceNumber()); | 69 item_.documentSequenceNumber()); |
70 } | 70 } |
71 | 71 |
72 if (clone_children_of_target || !is_target_frame) { | 72 // TODO(creis): This needs to be updated to handle HistoryEntry in |
| 73 // subframe processes, where the main frame isn't guaranteed to be in the |
| 74 // same process. |
| 75 if (current_frame && (clone_children_of_target || !is_target_frame)) { |
73 for (WebFrame* child = current_frame->GetWebFrame()->firstChild(); child; | 76 for (WebFrame* child = current_frame->GetWebFrame()->firstChild(); child; |
74 child = child->nextSibling()) { | 77 child = child->nextSibling()) { |
75 RenderFrameImpl* child_render_frame = | 78 RenderFrameImpl* child_render_frame = |
76 RenderFrameImpl::FromWebFrame(child); | 79 RenderFrameImpl::FromWebFrame(child); |
77 // TODO(creis): A child frame may be a RenderFrameProxy. We should still | 80 // TODO(creis): A child frame may be a RenderFrameProxy. We should still |
78 // process its children, but that will be possible when we move this code | 81 // process its children, but that will be possible when we move this code |
79 // to the browser process in https://crbug.com/236848. | 82 // to the browser process in https://crbug.com/236848. |
80 if (!child_render_frame) | 83 if (!child_render_frame) |
81 continue; | 84 continue; |
82 HistoryNode* child_history_node = | 85 HistoryNode* child_history_node = |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 return unique_names_to_items_[frame->GetWebFrame()->uniqueName().utf8()]; | 159 return unique_names_to_items_[frame->GetWebFrame()->uniqueName().utf8()]; |
157 } | 160 } |
158 | 161 |
159 WebHistoryItem HistoryEntry::GetItemForFrame(RenderFrameImpl* frame) { | 162 WebHistoryItem HistoryEntry::GetItemForFrame(RenderFrameImpl* frame) { |
160 if (HistoryNode* history_node = GetHistoryNodeForFrame(frame)) | 163 if (HistoryNode* history_node = GetHistoryNodeForFrame(frame)) |
161 return history_node->item(); | 164 return history_node->item(); |
162 return WebHistoryItem(); | 165 return WebHistoryItem(); |
163 } | 166 } |
164 | 167 |
165 } // namespace content | 168 } // namespace content |
OLD | NEW |