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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 } | 180 } |
181 | 181 |
182 void HistoryController::UpdateForCommit(RenderFrameImpl* frame, | 182 void HistoryController::UpdateForCommit(RenderFrameImpl* frame, |
183 const WebHistoryItem& item, | 183 const WebHistoryItem& item, |
184 WebHistoryCommitType commit_type, | 184 WebHistoryCommitType commit_type, |
185 bool navigation_within_page) { | 185 bool navigation_within_page) { |
186 switch (commit_type) { | 186 switch (commit_type) { |
187 case blink::WebBackForwardCommit: | 187 case blink::WebBackForwardCommit: |
188 if (!provisional_entry_) | 188 if (!provisional_entry_) |
189 return; | 189 return; |
190 // Commit the provisional entry, but only if this back/forward item | 190 current_entry_.reset(provisional_entry_.release()); |
191 // matches it. Otherwise it could be a commit from an earlier attempt to | |
192 // go back/forward, and we should leave the provisional entry in place. | |
193 if (HistoryEntry::HistoryNode* node = | |
194 provisional_entry_->GetHistoryNodeForFrame(frame)) { | |
195 if (node->item().itemSequenceNumber() == item.itemSequenceNumber()) | |
196 current_entry_.reset(provisional_entry_.release()); | |
197 } | |
198 if (HistoryEntry::HistoryNode* node = | 191 if (HistoryEntry::HistoryNode* node = |
199 current_entry_->GetHistoryNodeForFrame(frame)) { | 192 current_entry_->GetHistoryNodeForFrame(frame)) { |
200 node->set_item(item); | 193 node->set_item(item); |
201 } | 194 } |
202 break; | 195 break; |
203 case blink::WebStandardCommit: | 196 case blink::WebStandardCommit: |
204 CreateNewBackForwardItem(frame, item, navigation_within_page); | 197 CreateNewBackForwardItem(frame, item, navigation_within_page); |
205 break; | 198 break; |
206 case blink::WebInitialCommitInChildFrame: | 199 case blink::WebInitialCommitInChildFrame: |
207 UpdateForInitialLoadInChildFrame(frame, item); | 200 UpdateForInitialLoadInChildFrame(frame, item); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 bool clone_children_of_target) { | 248 bool clone_children_of_target) { |
256 if (!current_entry_) { | 249 if (!current_entry_) { |
257 current_entry_.reset(new HistoryEntry(new_item)); | 250 current_entry_.reset(new HistoryEntry(new_item)); |
258 } else { | 251 } else { |
259 current_entry_.reset(current_entry_->CloneAndReplace( | 252 current_entry_.reset(current_entry_->CloneAndReplace( |
260 new_item, clone_children_of_target, target_frame, render_view_)); | 253 new_item, clone_children_of_target, target_frame, render_view_)); |
261 } | 254 } |
262 } | 255 } |
263 | 256 |
264 } // namespace content | 257 } // namespace content |
OLD | NEW |