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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2557233002: Revert of Set user_gesture bit at NavigationHandle creation time. (Closed)
Patch Set: rebase Created 4 years 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/public/test/render_view_test.cc ('k') | content/test/test_render_frame_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 5007f28f5c19f40d05bae2cdb26a00a3940ca5de..8254d0842eb301932c4fb7dfdaa787db0422bb50 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -642,16 +642,13 @@ CommonNavigationParams MakeCommonNavigationParams(
? FrameMsg_Navigate_Type::RELOAD
: FrameMsg_Navigate_Type::NORMAL;
- NavigationGesture gesture = info.urlRequest.hasUserGesture()
- ? NavigationGestureUser
- : NavigationGestureAuto;
const RequestExtraData* extra_data =
static_cast<RequestExtraData*>(info.urlRequest.getExtraData());
DCHECK(extra_data);
return CommonNavigationParams(
info.urlRequest.url(), referrer, extra_data->transition_type(),
- navigation_type, gesture, true, info.replacesCurrentHistoryItem,
- ui_timestamp, report_type, GURL(), GURL(),
+ navigation_type, true, info.replacesCurrentHistoryItem, ui_timestamp,
+ report_type, GURL(), GURL(),
static_cast<LoFiState>(info.urlRequest.getLoFiState()),
base::TimeTicks::Now(), info.urlRequest.httpMethod().latin1(),
GetRequestBodyForWebURLRequest(info.urlRequest));
@@ -3391,11 +3388,10 @@ void RenderFrameImpl::didStartProvisionalLoad(blink::WebLocalFrame* frame) {
NavigationStateImpl* navigation_state = static_cast<NavigationStateImpl*>(
document_state->navigation_state());
bool is_top_most = !frame->parent();
- NavigationGesture gesture = WebUserGestureIndicator::isProcessingUserGesture()
- ? NavigationGestureUser
- : NavigationGestureAuto;
if (is_top_most) {
- render_view_->set_navigation_gesture(gesture);
+ render_view_->set_navigation_gesture(
+ WebUserGestureIndicator::isProcessingUserGesture() ?
+ NavigationGestureUser : NavigationGestureAuto);
} else if (ds->replacesCurrentHistoryItem()) {
// Subframe navigations that don't add session history items must be
// marked with AUTO_SUBFRAME. See also didFailProvisionalLoad for how we
@@ -3413,7 +3409,7 @@ void RenderFrameImpl::didStartProvisionalLoad(blink::WebLocalFrame* frame) {
observer.DidStartProvisionalLoad();
Send(new FrameHostMsg_DidStartProvisionalLoad(
- routing_id_, ds->request().url(), navigation_start, gesture));
+ routing_id_, ds->request().url(), navigation_start));
}
void RenderFrameImpl::didReceiveServerRedirectForProvisionalLoad(
@@ -4791,8 +4787,8 @@ void RenderFrameImpl::SendDidCommitProvisionalLoad(
params.searchable_form_url = internal_data->searchable_form_url();
params.searchable_form_encoding = internal_data->searchable_form_encoding();
- params.gesture = render_view_->navigation_gesture();
- render_view_->set_navigation_gesture(NavigationGestureUnknown);
+ params.gesture = render_view_->navigation_gesture_;
+ render_view_->navigation_gesture_ = NavigationGestureUnknown;
// Make navigation state a part of the DidCommitProvisionalLoad message so
// that committed entry has it at all times.
@@ -5031,9 +5027,8 @@ void RenderFrameImpl::OnCommitNavigation(
// If the request was initiated in the context of a user gesture then make
// sure that the navigation also executes in the context of a user gesture.
std::unique_ptr<blink::WebScopedUserGesture> gesture(
- (common_params.gesture == NavigationGestureUser)
- ? new blink::WebScopedUserGesture(frame_)
- : nullptr);
+ request_params.has_user_gesture ? new blink::WebScopedUserGesture(frame_)
+ : nullptr);
NavigateInternal(common_params, StartNavigationParams(), request_params,
std::move(stream_override));
@@ -5763,7 +5758,7 @@ void RenderFrameImpl::NavigateInternal(
bool has_history_navigation_in_frame = false;
#if defined(OS_ANDROID)
- request.setHasUserGesture(common_params.gesture == NavigationGestureUser);
+ request.setHasUserGesture(request_params.has_user_gesture);
#endif
if (browser_side_navigation) {
@@ -6131,6 +6126,7 @@ void RenderFrameImpl::BeginNavigation(const NavigationPolicyInfo& info) {
BeginNavigationParams begin_navigation_params(
GetWebURLRequestHeaders(info.urlRequest),
GetLoadFlagsForWebURLRequest(info.urlRequest),
+ info.urlRequest.hasUserGesture(),
info.urlRequest.skipServiceWorker() !=
blink::WebURLRequest::SkipServiceWorker::None,
GetRequestContextTypeForWebURLRequest(info.urlRequest));
« no previous file with comments | « content/public/test/render_view_test.cc ('k') | content/test/test_render_frame_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698