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

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

Issue 358973005: Navigation transitions: Pass is_transition_navigation flag up to the embedder (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months 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
Index: content/browser/frame_host/navigator_impl.cc
diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc
index 1af57c7c140fe84d2354331e736ab50b2f420236..d28ca9e52e4b8e96331a0a4063c538d7aee37070 100644
--- a/content/browser/frame_host/navigator_impl.cc
+++ b/content/browser/frame_host/navigator_impl.cc
@@ -144,7 +144,8 @@ NavigationController* NavigatorImpl::GetController() {
void NavigatorImpl::DidStartProvisionalLoad(
RenderFrameHostImpl* render_frame_host,
int parent_routing_id,
- const GURL& url) {
+ const GURL& url,
+ bool is_transition_navigation) {
bool is_error_page = (url.spec() == kUnreachableWebDataURL);
bool is_iframe_srcdoc = (url.spec() == kAboutSrcDocURL);
GURL validated_url(url);
@@ -154,6 +155,10 @@ void NavigatorImpl::DidStartProvisionalLoad(
bool is_main_frame = render_frame_host->frame_tree_node()->IsMainFrame();
NavigationEntryImpl* pending_entry =
NavigationEntryImpl::FromNavigationEntry(controller_->GetPendingEntry());
+
+ is_transition_navigation |= (pending_entry &&
+ pending_entry->is_transition_navigation());
+
if (is_main_frame) {
// If there is no browser-initiated pending entry for this navigation and it
// is not for the error URL, create a pending entry using the current
@@ -185,6 +190,9 @@ void NavigatorImpl::DidStartProvisionalLoad(
if (delegate_)
delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL);
}
+
+ if (delegate_ && is_transition_navigation)
+ delegate_->DidStartNavigationTransition(render_frame_host);
nasko 2014/07/03 09:39:30 Why add a full new delegate method when you are pa
oystein (OOO til 10th of July) 2014/07/22 00:02:43 I could pass it along to WebContentsObserver::DidS
}
if (delegate_) {
@@ -559,7 +567,8 @@ void NavigatorImpl::RequestOpenURL(
const Referrer& referrer,
WindowOpenDisposition disposition,
bool should_replace_current_entry,
- bool user_gesture) {
+ bool user_gesture,
+ bool is_transition_navigation) {
SiteInstance* current_site_instance =
GetRenderManager(render_frame_host)->current_frame_host()->
GetSiteInstance();
@@ -579,7 +588,7 @@ void NavigatorImpl::RequestOpenURL(
RequestTransferURL(
render_frame_host, url, redirect_chain, referrer, PAGE_TRANSITION_LINK,
disposition, GlobalRequestID(),
- should_replace_current_entry, user_gesture);
+ should_replace_current_entry, user_gesture, is_transition_navigation);
}
void NavigatorImpl::RequestTransferURL(
@@ -591,7 +600,8 @@ void NavigatorImpl::RequestTransferURL(
WindowOpenDisposition disposition,
const GlobalRequestID& transferred_global_request_id,
bool should_replace_current_entry,
- bool user_gesture) {
+ bool user_gesture,
+ bool is_transition_navigation) {
GURL dest_url(url);
SiteInstance* current_site_instance =
GetRenderManager(render_frame_host)->current_frame_host()->
@@ -614,6 +624,7 @@ void NavigatorImpl::RequestTransferURL(
params.transferred_global_request_id = transferred_global_request_id;
params.should_replace_current_entry = should_replace_current_entry;
params.user_gesture = user_gesture;
+ params.is_transition_navigation = is_transition_navigation;
if (GetRenderManager(render_frame_host)->web_ui()) {
// Web UI pages sometimes want to override the page transition type for

Powered by Google App Engine
This is Rietveld 408576698