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

Side by Side Diff: ios/web/navigation/navigation_manager_impl.mm

Issue 2584513003: PlzNavigate: identify same-page browser-initiated navigation. (Closed)
Patch Set: Rebase. Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "ios/web/navigation/navigation_manager_impl.h" 5 #import "ios/web/navigation/navigation_manager_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 14 matching lines...) Expand all
25 #endif 25 #endif
26 26
27 namespace { 27 namespace {
28 28
29 // Checks whether or not two URL are an in-page navigation (differing only 29 // Checks whether or not two URL are an in-page navigation (differing only
30 // in the fragment). 30 // in the fragment).
31 bool AreURLsInPageNavigation(const GURL& existing_url, const GURL& new_url) { 31 bool AreURLsInPageNavigation(const GURL& existing_url, const GURL& new_url) {
32 if (existing_url == new_url || !new_url.has_ref()) 32 if (existing_url == new_url || !new_url.has_ref())
33 return false; 33 return false;
34 34
35 url::Replacements<char> replacements; 35 return GURL::EqualsIgnoringRef(existing_url, new_url);
36 replacements.ClearRef();
37 return existing_url.ReplaceComponents(replacements) ==
38 new_url.ReplaceComponents(replacements);
39 } 36 }
40 37
41 } // anonymous namespace 38 } // anonymous namespace
42 39
43 namespace web { 40 namespace web {
44 41
45 NavigationManager::WebLoadParams::WebLoadParams(const GURL& url) 42 NavigationManager::WebLoadParams::WebLoadParams(const GURL& url)
46 : url(url), 43 : url(url),
47 transition_type(ui::PAGE_TRANSITION_LINK), 44 transition_type(ui::PAGE_TRANSITION_LINK),
48 is_renderer_initiated(false), 45 is_renderer_initiated(false),
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 } 396 }
400 397
401 bool NavigationManagerImpl::IsRedirectItemAtIndex(int index) const { 398 bool NavigationManagerImpl::IsRedirectItemAtIndex(int index) const {
402 DCHECK_GT(index, 0); 399 DCHECK_GT(index, 0);
403 DCHECK_LT(index, GetItemCount()); 400 DCHECK_LT(index, GetItemCount());
404 ui::PageTransition transition = GetItemAtIndex(index)->GetTransitionType(); 401 ui::PageTransition transition = GetItemAtIndex(index)->GetTransitionType();
405 return transition & ui::PAGE_TRANSITION_IS_REDIRECT_MASK; 402 return transition & ui::PAGE_TRANSITION_IS_REDIRECT_MASK;
406 } 403 }
407 404
408 } // namespace web 405 } // namespace web
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698