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

Unified Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 2485783002: PlzNavigate: send searchable form data to the browser side on form submission. (Closed)
Patch Set: rebase&resolve 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/frame_host/navigation_request.cc ('k') | content/common/frame_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/render_frame_host_impl.cc
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index 2e4df9bfdcc1f3fdd252fdebc092bd14450be8ef..0c3bba0a1bab2cea7363d3cd90ba21e9b9446fc5 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -1224,6 +1224,23 @@ void RenderFrameHostImpl::OnDidCommitProvisionalLoad(const IPC::Message& msg) {
TakeNavigationHandleForCommit(validated_params);
DCHECK(navigation_handle);
+ // PlzNavigate sends searchable form data in the BeginNavigation message
+ // while non-PlzNavigate sends it in the DidCommitProvisionalLoad message.
+ // Update |navigation_handle| if necessary.
+ if (!IsBrowserSideNavigationEnabled() &&
+ !validated_params.searchable_form_url.is_empty()) {
+ navigation_handle->set_searchable_form_url(
+ validated_params.searchable_form_url);
+ navigation_handle->set_searchable_form_encoding(
+ validated_params.searchable_form_encoding);
+
+ // Reset them so that they are consistent in both the PlzNavigate and
+ // non-PlzNavigate case. Users should use those values from
+ // NavigationHandle.
+ validated_params.searchable_form_url = GURL();
+ validated_params.searchable_form_encoding = std::string();
+ }
+
accessibility_reset_count_ = 0;
frame_tree_node()->navigator()->DidNavigate(this, validated_params,
std::move(navigation_handle));
@@ -1786,14 +1803,17 @@ void RenderFrameHostImpl::OnBeginNavigation(
CommonNavigationParams validated_params = common_params;
GetProcess()->FilterURL(false, &validated_params.url);
+ BeginNavigationParams validated_begin_params = begin_params;
+ GetProcess()->FilterURL(true, &validated_begin_params.searchable_form_url);
+
if (waiting_for_init_) {
- pendinging_navigate_ =
- base::MakeUnique<PendingNavigation>(validated_params, begin_params);
+ pendinging_navigate_ = base::MakeUnique<PendingNavigation>(
+ validated_params, validated_begin_params);
return;
}
frame_tree_node()->navigator()->OnBeginNavigation(
- frame_tree_node(), validated_params, begin_params);
+ frame_tree_node(), validated_params, validated_begin_params);
}
void RenderFrameHostImpl::OnDispatchLoad() {
« no previous file with comments | « content/browser/frame_host/navigation_request.cc ('k') | content/common/frame_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698