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

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

Issue 1002953004: Ensure we properly set PageTransition for iframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « no previous file | content/renderer/render_frame_impl.cc » ('j') | content/renderer/render_frame_impl.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigation_controller_impl.cc
diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc
index 6610cb1202c04ab2360021ba4a1df4f4aba3f4ea..d49c1feffc859a6ddffe0329ebb9e4eeba1030a8 100644
--- a/content/browser/frame_host/navigation_controller_impl.cc
+++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -906,8 +906,15 @@ NavigationType NavigationControllerImpl::ClassifyNavigation(
// (see http://crbug.com/236848). For now, we assume this means the
// child frame loaded and proceed. Note that this may do the wrong thing
// for cross-process AUTO_SUBFRAME navigations.
Avi (use Gerrit) 2015/03/12 20:40:28 This comment seems out-of-date with this change.
Nate Chapin 2015/03/12 20:51:12 Removed.
- if (rfh->IsCrossProcessSubframe())
- return NAVIGATION_TYPE_NEW_SUBFRAME;
+ if (rfh->IsCrossProcessSubframe()) {
+ CHECK(!ui::PageTransitionIsMainFrame(params.transition));
+ if (ui::PageTransitionCoreTypeIs(params.transition,
+ ui::PAGE_TRANSITION_MANUAL_SUBFRAME)) {
+ return NAVIGATION_TYPE_NEW_SUBFRAME;
+ } else {
+ return NAVIGATION_TYPE_AUTO_SUBFRAME;
+ }
+ }
// The renderer generates the page IDs, and so if it gives us the invalid
// page ID (-1) we know it didn't actually navigate. This happens in a few
@@ -1243,13 +1250,6 @@ void NavigationControllerImpl::RendererDidNavigateNewSubframe(
// the handling of immediate redirects. TODO(avi): Is this still valid? I'm
// pretty sure that's there's nothing left of that code and that we should
// take this out.
- //
- // Except for cross-process iframes; this doesn't work yet for them.
- if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kSitePerProcess)) {
- NOTREACHED();
- }
-
DiscardNonCommittedEntriesInternal();
return;
Avi (use Gerrit) 2015/03/12 20:40:28 This is the wrong fix; this would always ignore a
Nate Chapin 2015/03/12 20:51:12 Done.
}
« no previous file with comments | « no previous file | content/renderer/render_frame_impl.cc » ('j') | content/renderer/render_frame_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698