summaryrefslogtreecommitdiffstats
path: root/chrome/browser/navigation_controller.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/navigation_controller.cc')
-rw-r--r--chrome/browser/navigation_controller.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/chrome/browser/navigation_controller.cc b/chrome/browser/navigation_controller.cc
index 2b3f96e..deee023 100644
--- a/chrome/browser/navigation_controller.cc
+++ b/chrome/browser/navigation_controller.cc
@@ -683,9 +683,6 @@ NavigationType::Type NavigationController::ClassifyNavigation(
return NavigationType::SAME_PAGE;
}
- if (AreURLsInPageNavigation(existing_entry->url(), params.url))
- return NavigationType::IN_PAGE;
-
if (!PageTransition::IsMainFrame(params.transition)) {
// All manual subframes would get new IDs and were handled above, so we
// know this is auto. Since the current page was found in the navigation
@@ -694,6 +691,14 @@ NavigationType::Type NavigationController::ClassifyNavigation(
return NavigationType::AUTO_SUBFRAME;
}
+ // Any toplevel navigations with the same base (minus the reference fragment)
+ // are in-page navigations. We weeded out subframe navigations above. Most of
+ // the time this doesn't matter since WebKit doesn't tell us about subframe
+ // navigations that don't actually navigate, but it can happen when there is
+ // an encoding override (it always sends a navigation request).
+ if (AreURLsInPageNavigation(existing_entry->url(), params.url))
+ return NavigationType::IN_PAGE;
+
// Since we weeded out "new" navigations above, we know this is an existing
// (back/forward) navigation.
return NavigationType::EXISTING_PAGE;