Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Side by Side Diff: content/browser/frame_host/navigator_impl.cc

Issue 2477623002: Don't fire onbeforeunload for same document history navigations with PlzNavigate. (Closed)
Patch Set: review comment Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/test/test_render_frame_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/navigator_impl.h" 5 #include "content/browser/frame_host/navigator_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after
1120 LoFiState lofi_state, 1120 LoFiState lofi_state,
1121 bool is_same_document_history_load, 1121 bool is_same_document_history_load,
1122 bool is_history_navigation_in_new_child, 1122 bool is_history_navigation_in_new_child,
1123 base::TimeTicks navigation_start) { 1123 base::TimeTicks navigation_start) {
1124 CHECK(IsBrowserSideNavigationEnabled()); 1124 CHECK(IsBrowserSideNavigationEnabled());
1125 DCHECK(frame_tree_node); 1125 DCHECK(frame_tree_node);
1126 1126
1127 // This value must be set here because creating a NavigationRequest might 1127 // This value must be set here because creating a NavigationRequest might
1128 // change the renderer live/non-live status and change this result. 1128 // change the renderer live/non-live status and change this result.
1129 bool should_dispatch_beforeunload = 1129 bool should_dispatch_beforeunload =
1130 !is_same_document_history_load &&
1130 frame_tree_node->current_frame_host()->ShouldDispatchBeforeUnload(); 1131 frame_tree_node->current_frame_host()->ShouldDispatchBeforeUnload();
1131 FrameMsg_Navigate_Type::Value navigation_type = 1132 FrameMsg_Navigate_Type::Value navigation_type =
1132 GetNavigationType(controller_->GetBrowserContext(), entry, reload_type); 1133 GetNavigationType(controller_->GetBrowserContext(), entry, reload_type);
1133 std::unique_ptr<NavigationRequest> scoped_request = 1134 std::unique_ptr<NavigationRequest> scoped_request =
1134 NavigationRequest::CreateBrowserInitiated( 1135 NavigationRequest::CreateBrowserInitiated(
1135 frame_tree_node, dest_url, dest_referrer, frame_entry, entry, 1136 frame_tree_node, dest_url, dest_referrer, frame_entry, entry,
1136 navigation_type, lofi_state, is_same_document_history_load, 1137 navigation_type, lofi_state, is_same_document_history_load,
1137 is_history_navigation_in_new_child, navigation_start, controller_); 1138 is_history_navigation_in_new_child, navigation_start, controller_);
1138 NavigationRequest* navigation_request = scoped_request.get(); 1139 NavigationRequest* navigation_request = scoped_request.get();
1139 1140
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
1261 if (navigation_handle) 1262 if (navigation_handle)
1262 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID()); 1263 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID());
1263 1264
1264 controller_->SetPendingEntry(std::move(entry)); 1265 controller_->SetPendingEntry(std::move(entry));
1265 if (delegate_) 1266 if (delegate_)
1266 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); 1267 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL);
1267 } 1268 }
1268 } 1269 }
1269 1270
1270 } // namespace content 1271 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/test/test_render_frame_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698