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

Side by Side Diff: content/browser/frame_host/navigator_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 unified diff | Download patch
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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 return delegate_; 132 return delegate_;
133 } 133 }
134 134
135 NavigationController* NavigatorImpl::GetController() { 135 NavigationController* NavigatorImpl::GetController() {
136 return controller_; 136 return controller_;
137 } 137 }
138 138
139 void NavigatorImpl::DidStartProvisionalLoad( 139 void NavigatorImpl::DidStartProvisionalLoad(
140 RenderFrameHostImpl* render_frame_host, 140 RenderFrameHostImpl* render_frame_host,
141 const GURL& url, 141 const GURL& url,
142 const base::TimeTicks& navigation_start, 142 const base::TimeTicks& navigation_start) {
143 NavigationGesture gesture) {
144 bool is_main_frame = render_frame_host->frame_tree_node()->IsMainFrame(); 143 bool is_main_frame = render_frame_host->frame_tree_node()->IsMainFrame();
145 bool is_error_page = (url.spec() == kUnreachableWebDataURL); 144 bool is_error_page = (url.spec() == kUnreachableWebDataURL);
146 GURL validated_url(url); 145 GURL validated_url(url);
147 RenderProcessHost* render_process_host = render_frame_host->GetProcess(); 146 RenderProcessHost* render_process_host = render_frame_host->GetProcess();
148 render_process_host->FilterURL(false, &validated_url); 147 render_process_host->FilterURL(false, &validated_url);
149 148
150 // Do not allow browser plugin guests to navigate to non-web URLs, since they 149 // Do not allow browser plugin guests to navigate to non-web URLs, since they
151 // cannot swap processes or grant bindings. 150 // cannot swap processes or grant bindings.
152 ChildProcessSecurityPolicyImpl* policy = 151 ChildProcessSecurityPolicyImpl* policy =
153 ChildProcessSecurityPolicyImpl::GetInstance(); 152 ChildProcessSecurityPolicyImpl::GetInstance();
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 if (pending_entry) { 196 if (pending_entry) {
198 is_renderer_initiated = pending_entry->is_renderer_initiated(); 197 is_renderer_initiated = pending_entry->is_renderer_initiated();
199 pending_nav_entry_id = pending_entry->GetUniqueID(); 198 pending_nav_entry_id = pending_entry->GetUniqueID();
200 started_from_context_menu = pending_entry->has_started_from_context_menu(); 199 started_from_context_menu = pending_entry->has_started_from_context_menu();
201 } 200 }
202 201
203 render_frame_host->SetNavigationHandle(NavigationHandleImpl::Create( 202 render_frame_host->SetNavigationHandle(NavigationHandleImpl::Create(
204 validated_url, render_frame_host->frame_tree_node(), 203 validated_url, render_frame_host->frame_tree_node(),
205 is_renderer_initiated, 204 is_renderer_initiated,
206 false, // is_same_page 205 false, // is_same_page
207 navigation_start, pending_nav_entry_id, gesture, 206 navigation_start, pending_nav_entry_id,
208 started_from_context_menu)); 207 started_from_context_menu));
209 } 208 }
210 209
211 void NavigatorImpl::DidFailProvisionalLoadWithError( 210 void NavigatorImpl::DidFailProvisionalLoadWithError(
212 RenderFrameHostImpl* render_frame_host, 211 RenderFrameHostImpl* render_frame_host,
213 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) { 212 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) {
214 VLOG(1) << "Failed Provisional Load: " << params.url.possibly_invalid_spec() 213 VLOG(1) << "Failed Provisional Load: " << params.url.possibly_invalid_spec()
215 << ", error_code: " << params.error_code 214 << ", error_code: " << params.error_code
216 << ", error_description: " << params.error_description 215 << ", error_description: " << params.error_description
217 << ", showing_repost_interstitial: " << 216 << ", showing_repost_interstitial: " <<
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after
960 DCHECK(frame_tree_node); 959 DCHECK(frame_tree_node);
961 960
962 NavigationRequest* ongoing_navigation_request = 961 NavigationRequest* ongoing_navigation_request =
963 frame_tree_node->navigation_request(); 962 frame_tree_node->navigation_request();
964 963
965 // The renderer-initiated navigation request is ignored iff a) there is an 964 // The renderer-initiated navigation request is ignored iff a) there is an
966 // ongoing request b) which is browser or user-initiated and c) the renderer 965 // ongoing request b) which is browser or user-initiated and c) the renderer
967 // request is not user-initiated. 966 // request is not user-initiated.
968 if (ongoing_navigation_request && 967 if (ongoing_navigation_request &&
969 (ongoing_navigation_request->browser_initiated() || 968 (ongoing_navigation_request->browser_initiated() ||
970 ongoing_navigation_request->common_params().gesture == 969 ongoing_navigation_request->begin_params().has_user_gesture) &&
971 NavigationGestureUser) && 970 !begin_params.has_user_gesture) {
972 common_params.gesture != NavigationGestureUser) {
973 RenderFrameHost* current_frame_host = 971 RenderFrameHost* current_frame_host =
974 frame_tree_node->render_manager()->current_frame_host(); 972 frame_tree_node->render_manager()->current_frame_host();
975 current_frame_host->Send( 973 current_frame_host->Send(
976 new FrameMsg_Stop(current_frame_host->GetRoutingID())); 974 new FrameMsg_Stop(current_frame_host->GetRoutingID()));
977 return; 975 return;
978 } 976 }
979 977
980 // In all other cases the current navigation, if any, is canceled and a new 978 // In all other cases the current navigation, if any, is canceled and a new
981 // NavigationRequest is created for the node. 979 // NavigationRequest is created for the node.
982 frame_tree_node->CreatedNavigationRequest( 980 frame_tree_node->CreatedNavigationRequest(
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
1267 if (navigation_handle) 1265 if (navigation_handle)
1268 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID()); 1266 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID());
1269 1267
1270 controller_->SetPendingEntry(std::move(entry)); 1268 controller_->SetPendingEntry(std::move(entry));
1271 if (delegate_) 1269 if (delegate_)
1272 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); 1270 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL);
1273 } 1271 }
1274 } 1272 }
1275 1273
1276 } // namespace content 1274 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigator_impl.h ('k') | content/browser/frame_host/navigator_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698