Chromium Code Reviews| 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 162 WebHistoryCommitType commit_type, | 162 WebHistoryCommitType commit_type, |
| 163 bool navigation_within_page) { | 163 bool navigation_within_page) { |
| 164 if (commit_type == blink::WebBackForwardCommit) { | 164 if (commit_type == blink::WebBackForwardCommit) { |
| 165 if (!provisional_entry_) | 165 if (!provisional_entry_) |
| 166 return; | 166 return; |
| 167 current_entry_.reset(provisional_entry_.release()); | 167 current_entry_.reset(provisional_entry_.release()); |
| 168 } else if (commit_type == blink::WebStandardCommit) { | 168 } else if (commit_type == blink::WebStandardCommit) { |
| 169 CreateNewBackForwardItem(frame, item, navigation_within_page); | 169 CreateNewBackForwardItem(frame, item, navigation_within_page); |
| 170 } else if (commit_type == blink::WebInitialCommitInChildFrame) { | 170 } else if (commit_type == blink::WebInitialCommitInChildFrame) { |
| 171 UpdateForInitialLoadInChildFrame(frame, item); | 171 UpdateForInitialLoadInChildFrame(frame, item); |
| 172 } else { | |
|
Nate Chapin
2015/04/30 18:24:10
Now that this if-else block includes all WebHistor
Charlie Reis
2015/04/30 18:36:30
Done.
| |
| 173 // Even for inert commits (e.g., location.replace, client redirects), make | |
| 174 // sure the current entry gets updated, if there is one. | |
| 175 DCHECK_EQ(blink::WebHistoryInertCommit, commit_type); | |
| 176 if (current_entry_) { | |
| 177 if (HistoryEntry::HistoryNode* node = | |
| 178 current_entry_->GetHistoryNodeForFrame(frame)) { | |
| 179 node->set_item(item); | |
| 180 } | |
| 181 } | |
| 172 } | 182 } |
| 173 } | 183 } |
| 174 | 184 |
| 175 HistoryEntry* HistoryController::GetCurrentEntry() { | 185 HistoryEntry* HistoryController::GetCurrentEntry() { |
| 176 return current_entry_.get(); | 186 return current_entry_.get(); |
| 177 } | 187 } |
| 178 | 188 |
| 179 WebHistoryItem HistoryController::GetItemForNewChildFrame( | 189 WebHistoryItem HistoryController::GetItemForNewChildFrame( |
| 180 RenderFrameImpl* frame) const { | 190 RenderFrameImpl* frame) const { |
| 181 if (navigation_params_.get()) { | 191 if (navigation_params_.get()) { |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 203 if (!current_entry_) { | 213 if (!current_entry_) { |
| 204 current_entry_.reset( | 214 current_entry_.reset( |
| 205 new HistoryEntry(new_item, target_frame->GetRoutingID())); | 215 new HistoryEntry(new_item, target_frame->GetRoutingID())); |
| 206 } else { | 216 } else { |
| 207 current_entry_.reset(current_entry_->CloneAndReplace( | 217 current_entry_.reset(current_entry_->CloneAndReplace( |
| 208 new_item, clone_children_of_target, target_frame, render_view_)); | 218 new_item, clone_children_of_target, target_frame, render_view_)); |
| 209 } | 219 } |
| 210 } | 220 } |
| 211 | 221 |
| 212 } // namespace content | 222 } // namespace content |
| OLD | NEW |