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

Side by Side Diff: content/browser/frame_host/navigation_controller_impl.cc

Issue 304763002: Trust the renderer's same-document navigation flag if it is a same-origin nav. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: isNavigationInPage->isFragmentNavigation, with caveat on the name Created 6 years, 6 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 | Annotate | Revision Log
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 #include "content/browser/frame_host/navigation_controller_impl.h" 5 #include "content/browser/frame_host/navigation_controller_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 // NOTE(darin): This code is only needed for backwards compat. 102 // NOTE(darin): This code is only needed for backwards compat.
103 SetPageStateIfEmpty((*entries)[i].get()); 103 SetPageStateIfEmpty((*entries)[i].get());
104 } 104 }
105 } 105 }
106 106
107 // See NavigationController::IsURLInPageNavigation for how this works and why. 107 // See NavigationController::IsURLInPageNavigation for how this works and why.
108 bool AreURLsInPageNavigation(const GURL& existing_url, 108 bool AreURLsInPageNavigation(const GURL& existing_url,
109 const GURL& new_url, 109 const GURL& new_url,
110 bool renderer_says_in_page, 110 bool renderer_says_in_page,
111 NavigationType navigation_type) { 111 NavigationType navigation_type) {
112 if (existing_url == new_url) 112 if (existing_url.GetOrigin() == new_url.GetOrigin())
113 return renderer_says_in_page; 113 return renderer_says_in_page;
114 114
115 if (!new_url.has_ref()) { 115 if (!new_url.has_ref()) {
116 // When going back from the ref URL to the non ref one the navigation type 116 // When going back from the ref URL to the non ref one the navigation type
117 // is IN_PAGE. 117 // is IN_PAGE.
118 return navigation_type == NAVIGATION_TYPE_IN_PAGE; 118 return navigation_type == NAVIGATION_TYPE_IN_PAGE;
119 } 119 }
120 120
121 url::Replacements<char> replacements; 121 url::Replacements<char> replacements;
122 replacements.ClearRef(); 122 replacements.ClearRef();
(...skipping 1647 matching lines...) Expand 10 before | Expand all | Expand 10 after
1770 } 1770 }
1771 } 1771 }
1772 } 1772 }
1773 1773
1774 void NavigationControllerImpl::SetGetTimestampCallbackForTest( 1774 void NavigationControllerImpl::SetGetTimestampCallbackForTest(
1775 const base::Callback<base::Time()>& get_timestamp_callback) { 1775 const base::Callback<base::Time()>& get_timestamp_callback) {
1776 get_timestamp_callback_ = get_timestamp_callback; 1776 get_timestamp_callback_ = get_timestamp_callback;
1777 } 1777 }
1778 1778
1779 } // namespace content 1779 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698