Index: ios/web/navigation/navigation_manager_impl.mm |
diff --git a/ios/web/navigation/navigation_manager_impl.mm b/ios/web/navigation/navigation_manager_impl.mm |
index 6d7835c92d4c47ab694a11b77e8198b34d45afa2..9c409dc79c8ddaacadb3ed38d0f83706fbb6aa24 100644 |
--- a/ios/web/navigation/navigation_manager_impl.mm |
+++ b/ios/web/navigation/navigation_manager_impl.mm |
@@ -18,28 +18,13 @@ |
#include "ios/web/public/load_committed_details.h" |
#import "ios/web/public/navigation_item.h" |
#import "ios/web/public/web_state/web_state.h" |
+#include "net/base/url_util.h" |
#include "ui/base/page_transition_types.h" |
#if !defined(__has_feature) || !__has_feature(objc_arc) |
#error "This file requires ARC support." |
#endif |
-namespace { |
- |
-// Checks whether or not two URL are an in-page navigation (differing only |
-// in the fragment). |
-bool AreURLsInPageNavigation(const GURL& existing_url, const GURL& new_url) { |
- if (existing_url == new_url || !new_url.has_ref()) |
- return false; |
- |
- url::Replacements<char> replacements; |
- replacements.ClearRef(); |
- return existing_url.ReplaceComponents(replacements) == |
- new_url.ReplaceComponents(replacements); |
-} |
- |
-} // anonymous namespace |
- |
namespace web { |
NavigationManager::WebLoadParams::WebLoadParams(const GURL& url) |
@@ -146,8 +131,8 @@ void NavigationManagerImpl::OnNavigationItemCommitted() { |
DCHECK([session_controller_ previousEntry]); |
details.previous_url = |
[session_controller_ previousEntry].navigationItem->GetURL(); |
- details.is_in_page = |
- AreURLsInPageNavigation(details.previous_url, details.item->GetURL()); |
+ details.is_in_page = net::IsFragmentAddedOrUpdated(details.previous_url, |
+ details.item->GetURL()); |
} else { |
details.previous_url = GURL(); |
details.is_in_page = NO; |