| Index: content/browser/frame_host/navigation_handle_impl.cc
|
| diff --git a/content/browser/frame_host/navigation_handle_impl.cc b/content/browser/frame_host/navigation_handle_impl.cc
|
| index c58618c022319fce402850e6248941d9f8fae473..e1a6614b08738cf91aea46a2261bc893d12dc13e 100644
|
| --- a/content/browser/frame_host/navigation_handle_impl.cc
|
| +++ b/content/browser/frame_host/navigation_handle_impl.cc
|
| @@ -51,10 +51,12 @@ std::unique_ptr<NavigationHandleImpl> NavigationHandleImpl::Create(
|
| bool is_srcdoc,
|
| const base::TimeTicks& navigation_start,
|
| int pending_nav_entry_id,
|
| + NavigationGesture gesture,
|
| bool started_from_context_menu) {
|
| return std::unique_ptr<NavigationHandleImpl>(new NavigationHandleImpl(
|
| url, frame_tree_node, is_renderer_initiated, is_same_page, is_srcdoc,
|
| - navigation_start, pending_nav_entry_id, started_from_context_menu));
|
| + navigation_start, pending_nav_entry_id, gesture,
|
| + started_from_context_menu));
|
| }
|
|
|
| NavigationHandleImpl::NavigationHandleImpl(
|
| @@ -65,9 +67,10 @@ NavigationHandleImpl::NavigationHandleImpl(
|
| bool is_srcdoc,
|
| const base::TimeTicks& navigation_start,
|
| int pending_nav_entry_id,
|
| + NavigationGesture gesture,
|
| bool started_from_context_menu)
|
| : url_(url),
|
| - has_user_gesture_(false),
|
| + gesture_(gesture),
|
| transition_(ui::PAGE_TRANSITION_LINK),
|
| is_external_protocol_(false),
|
| net_error_code_(net::OK),
|
| @@ -190,9 +193,7 @@ const Referrer& NavigationHandleImpl::GetReferrer() {
|
| }
|
|
|
| bool NavigationHandleImpl::HasUserGesture() {
|
| - CHECK_NE(INITIAL, state_)
|
| - << "This accessor should not be called before the request is started.";
|
| - return has_user_gesture_;
|
| + return gesture_ == NavigationGestureUser;
|
| }
|
|
|
| ui::PageTransition NavigationHandleImpl::GetPageTransition() {
|
| @@ -288,7 +289,6 @@ NavigationThrottle::ThrottleCheckResult
|
| NavigationHandleImpl::CallWillStartRequestForTesting(
|
| bool is_post,
|
| const Referrer& sanitized_referrer,
|
| - bool has_user_gesture,
|
| ui::PageTransition transition,
|
| bool is_external_protocol) {
|
| NavigationThrottle::ThrottleCheckResult result = NavigationThrottle::DEFER;
|
| @@ -304,7 +304,7 @@ NavigationHandleImpl::CallWillStartRequestForTesting(
|
| }
|
|
|
| WillStartRequest(method, resource_request_body, sanitized_referrer,
|
| - has_user_gesture, transition, is_external_protocol,
|
| + transition, is_external_protocol,
|
| REQUEST_CONTEXT_TYPE_LOCATION,
|
| base::Bind(&UpdateThrottleCheckResult, &result));
|
|
|
| @@ -397,7 +397,6 @@ void NavigationHandleImpl::WillStartRequest(
|
| const std::string& method,
|
| scoped_refptr<content::ResourceRequestBodyImpl> resource_request_body,
|
| const Referrer& sanitized_referrer,
|
| - bool has_user_gesture,
|
| ui::PageTransition transition,
|
| bool is_external_protocol,
|
| RequestContextType request_context_type,
|
| @@ -413,7 +412,6 @@ void NavigationHandleImpl::WillStartRequest(
|
| if (method_ == "POST")
|
| resource_request_body_ = resource_request_body;
|
| sanitized_referrer_ = sanitized_referrer;
|
| - has_user_gesture_ = has_user_gesture;
|
| transition_ = transition;
|
| is_external_protocol_ = is_external_protocol;
|
| request_context_type_ = request_context_type;
|
| @@ -524,7 +522,6 @@ void NavigationHandleImpl::DidCommitNavigation(
|
| CHECK_EQ(url_, params.url);
|
|
|
| method_ = params.method;
|
| - has_user_gesture_ = (params.gesture == NavigationGestureUser);
|
| transition_ = params.transition;
|
| render_frame_host_ = render_frame_host;
|
|
|
|
|