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

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

Issue 10871090: history.replaceState(..., location.href) clearing page-action icons. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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/web_contents/navigation_controller_impl.cc
===================================================================
--- content/browser/web_contents/navigation_controller_impl.cc (revision 153532)
+++ content/browser/web_contents/navigation_controller_impl.cc (working copy)
@@ -103,8 +103,13 @@
}
// See NavigationController::IsURLInPageNavigation for how this works and why.
-bool AreURLsInPageNavigation(const GURL& existing_url, const GURL& new_url) {
- if (existing_url == new_url || !new_url.has_ref()) {
+bool AreURLsInPageNavigation(const GURL& existing_url,
+ const GURL& new_url,
+ bool renderer_says_in_page) {
+ if (existing_url == new_url)
+ return renderer_says_in_page;
+
+ if (!new_url.has_ref()) {
// TODO(jcampan): what about when navigating back from a ref URL to the top
// non ref URL? Nothing is loaded in that case but we return false here.
// The user could also navigate from the ref URL to the non ref URL by
@@ -684,7 +689,8 @@
}
// is_in_page must be computed before the entry gets committed.
- details->is_in_page = IsURLInPageNavigation(params.url);
+ details->is_in_page = IsURLInPageNavigation(
+ params.url, params.was_within_same_page);
// Do navigation-type specific actions. These will make and commit an entry.
details->type = ClassifyNavigation(params);
@@ -871,7 +877,7 @@
// 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->GetURL(), params.url))
+ if (AreURLsInPageNavigation(existing_entry->GetURL(), params.url, false))
return content::NAVIGATION_TYPE_IN_PAGE;
// Since we weeded out "new" navigations above, we know this is an existing
@@ -1079,11 +1085,11 @@
return (i == entries_.end()) ? -1 : static_cast<int>(i - entries_.begin());
}
-bool NavigationControllerImpl::IsURLInPageNavigation(const GURL& url) const {
+bool NavigationControllerImpl::IsURLInPageNavigation(
+ const GURL& url, bool renderer_says_in_page) const {
NavigationEntry* last_committed = GetLastCommittedEntry();
- if (!last_committed)
- return false;
- return AreURLsInPageNavigation(last_committed->GetURL(), url);
+ return last_committed && AreURLsInPageNavigation(
+ last_committed->GetURL(), url, renderer_says_in_page);
}
void NavigationControllerImpl::CopyStateFrom(

Powered by Google App Engine
This is Rietveld 408576698