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

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 existing_url.EqualsIgnoringRef(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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 } 397 }
401 398
402 bool NavigationManagerImpl::IsRedirectItemAtIndex(int index) const { 399 bool NavigationManagerImpl::IsRedirectItemAtIndex(int index) const {
403 DCHECK_GT(index, 0); 400 DCHECK_GT(index, 0);
404 DCHECK_LT(index, GetItemCount()); 401 DCHECK_LT(index, GetItemCount());
405 ui::PageTransition transition = GetItemAtIndex(index)->GetTransitionType(); 402 ui::PageTransition transition = GetItemAtIndex(index)->GetTransitionType();
406 return transition & ui::PAGE_TRANSITION_IS_REDIRECT_MASK; 403 return transition & ui::PAGE_TRANSITION_IS_REDIRECT_MASK;
407 } 404 }
408 405
409 } // namespace web 406 } // namespace web
OLDNEW
« no previous file with comments | « content/test/test_web_contents.cc ('k') | testing/buildbot/filters/browser-side-navigation.linux.content_browsertests.filter » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698