Commit ee08663a authored by eugenebut's avatar eugenebut Committed by Commit bot

Renamed LoadCommittedDetails.is_in_page to is_same_document.

Old name was presumably used to match was_within_same_page IPC, but
SameDocument name better reflects the the type of the navigation
(navigation did not change the document object).

This change will make naming more consistent with the rest of Chromium
code.

BUG=695189
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

Review-Url: https://codereview.chromium.org/2841833002
Cr-Commit-Position: refs/heads/master@{#467720}
parent 594ca915
...@@ -184,7 +184,7 @@ void RPHReferenceManager::RPHWebContentsObserver::WebContentsDestroyed() { ...@@ -184,7 +184,7 @@ void RPHReferenceManager::RPHWebContentsObserver::WebContentsDestroyed() {
void RPHReferenceManager::RPHWebContentsObserver::NavigationEntryCommitted( void RPHReferenceManager::RPHWebContentsObserver::NavigationEntryCommitted(
const content::LoadCommittedDetails& load_details) { const content::LoadCommittedDetails& load_details) {
if (load_details.is_in_page) if (load_details.is_same_document)
return; return;
manager_->OnWebContentsDestroyedOrNavigated(web_contents()); manager_->OnWebContentsDestroyedOrNavigated(web_contents());
......
...@@ -157,7 +157,7 @@ bool SupervisedUserInterstitial::Init() { ...@@ -157,7 +157,7 @@ bool SupervisedUserInterstitial::Init() {
// Remove all the infobars which are attached to |web_contents_| and for // Remove all the infobars which are attached to |web_contents_| and for
// which ShouldExpire() returns true. // which ShouldExpire() returns true.
content::LoadCommittedDetails details; content::LoadCommittedDetails details;
// |details.is_in_page| is default false, and |details.is_main_frame| is // |details.is_same_page| is default false, and |details.is_main_frame| is
// default true. This results in is_navigation_to_different_page() returning // default true. This results in is_navigation_to_different_page() returning
// true. // true.
DCHECK(details.is_navigation_to_different_page()); DCHECK(details.is_navigation_to_different_page());
......
...@@ -160,7 +160,7 @@ void ChromeBubbleManager::DidToggleFullscreenModeForTab( ...@@ -160,7 +160,7 @@ void ChromeBubbleManager::DidToggleFullscreenModeForTab(
void ChromeBubbleManager::NavigationEntryCommitted( void ChromeBubbleManager::NavigationEntryCommitted(
const content::LoadCommittedDetails& load_details) { const content::LoadCommittedDetails& load_details) {
if (!load_details.is_in_page) if (!load_details.is_same_document)
CloseAllBubbles(BUBBLE_CLOSE_NAVIGATED); CloseAllBubbles(BUBBLE_CLOSE_NAVIGATED);
} }
......
...@@ -844,8 +844,8 @@ bool NavigationControllerImpl::RendererDidNavigate( ...@@ -844,8 +844,8 @@ bool NavigationControllerImpl::RendererDidNavigate(
// Do navigation-type specific actions. These will make and commit an entry. // Do navigation-type specific actions. These will make and commit an entry.
details->type = ClassifyNavigation(rfh, params); details->type = ClassifyNavigation(rfh, params);
// is_in_page must be computed before the entry gets committed. // is_same_document must be computed before the entry gets committed.
details->is_in_page = is_navigation_within_page; details->is_same_document = is_navigation_within_page;
// Save reload type and timestamp for a reload navigation to detect // Save reload type and timestamp for a reload navigation to detect
// consecutive reloads when the next reload is requested. // consecutive reloads when the next reload is requested.
...@@ -863,20 +863,20 @@ bool NavigationControllerImpl::RendererDidNavigate( ...@@ -863,20 +863,20 @@ bool NavigationControllerImpl::RendererDidNavigate(
switch (details->type) { switch (details->type) {
case NAVIGATION_TYPE_NEW_PAGE: case NAVIGATION_TYPE_NEW_PAGE:
RendererDidNavigateToNewPage(rfh, params, details->is_in_page, RendererDidNavigateToNewPage(rfh, params, details->is_same_document,
details->did_replace_entry, details->did_replace_entry,
navigation_handle); navigation_handle);
break; break;
case NAVIGATION_TYPE_EXISTING_PAGE: case NAVIGATION_TYPE_EXISTING_PAGE:
details->did_replace_entry = details->is_in_page; details->did_replace_entry = details->is_same_document;
RendererDidNavigateToExistingPage(rfh, params, details->is_in_page, RendererDidNavigateToExistingPage(rfh, params, details->is_same_document,
was_restored, navigation_handle); was_restored, navigation_handle);
break; break;
case NAVIGATION_TYPE_SAME_PAGE: case NAVIGATION_TYPE_SAME_PAGE:
RendererDidNavigateToSamePage(rfh, params, navigation_handle); RendererDidNavigateToSamePage(rfh, params, navigation_handle);
break; break;
case NAVIGATION_TYPE_NEW_SUBFRAME: case NAVIGATION_TYPE_NEW_SUBFRAME:
RendererDidNavigateNewSubframe(rfh, params, details->is_in_page, RendererDidNavigateNewSubframe(rfh, params, details->is_same_document,
details->did_replace_entry); details->did_replace_entry);
break; break;
case NAVIGATION_TYPE_AUTO_SUBFRAME: case NAVIGATION_TYPE_AUTO_SUBFRAME:
......
...@@ -3619,7 +3619,7 @@ void WebContentsImpl::DidNavigateAnyFramePostCommit( ...@@ -3619,7 +3619,7 @@ void WebContentsImpl::DidNavigateAnyFramePostCommit(
has_accessed_initial_document_ = false; has_accessed_initial_document_ = false;
// If we navigate off the page, close all JavaScript dialogs. // If we navigate off the page, close all JavaScript dialogs.
if (!details.is_in_page) if (!details.is_same_document)
CancelActiveAndPendingDialogs(); CancelActiveAndPendingDialogs();
// If this is a user-initiated navigation, start allowing JavaScript dialogs // If this is a user-initiated navigation, start allowing JavaScript dialogs
......
...@@ -11,10 +11,9 @@ LoadCommittedDetails::LoadCommittedDetails() ...@@ -11,10 +11,9 @@ LoadCommittedDetails::LoadCommittedDetails()
type(content::NAVIGATION_TYPE_UNKNOWN), type(content::NAVIGATION_TYPE_UNKNOWN),
previous_entry_index(-1), previous_entry_index(-1),
did_replace_entry(false), did_replace_entry(false),
is_in_page(false), is_same_document(false),
is_main_frame(true), is_main_frame(true),
http_status_code(0) { http_status_code(0) {}
}
LoadCommittedDetails::LoadCommittedDetails(const LoadCommittedDetails& other) = LoadCommittedDetails::LoadCommittedDetails(const LoadCommittedDetails& other) =
default; default;
......
...@@ -43,9 +43,12 @@ struct CONTENT_EXPORT LoadCommittedDetails { ...@@ -43,9 +43,12 @@ struct CONTENT_EXPORT LoadCommittedDetails {
// A non-user initiated redirect causes such replacement. // A non-user initiated redirect causes such replacement.
bool did_replace_entry; bool did_replace_entry;
// True if the navigation was in-page. This means that the active entry's // Whether the navigation happened without changing document. Examples of
// URL and the |previous_url| are the same except for reference fragments. // same document navigations are:
bool is_in_page; // * reference fragment navigations
// * pushState/replaceState
// * same page history navigation
bool is_same_document;
// True when the main frame was navigated. False means the navigation was a // True when the main frame was navigated. False means the navigation was a
// sub-frame. // sub-frame.
...@@ -55,7 +58,7 @@ struct CONTENT_EXPORT LoadCommittedDetails { ...@@ -55,7 +58,7 @@ struct CONTENT_EXPORT LoadCommittedDetails {
// scrolling to a fragment inside the current page). We often need this logic // scrolling to a fragment inside the current page). We often need this logic
// for showing or hiding something. // for showing or hiding something.
bool is_navigation_to_different_page() const { bool is_navigation_to_different_page() const {
return is_main_frame && !is_in_page; return is_main_frame && !is_same_document;
} }
// The HTTP status code for this entry.. // The HTTP status code for this entry..
......
...@@ -240,7 +240,7 @@ void ViewImpl::Observe(int type, ...@@ -240,7 +240,7 @@ void ViewImpl::Observe(int type,
details_ptr->type = static_cast<mojom::NavigationType>(lcd->type); details_ptr->type = static_cast<mojom::NavigationType>(lcd->type);
details_ptr->previous_entry_index = lcd->previous_entry_index; details_ptr->previous_entry_index = lcd->previous_entry_index;
details_ptr->previous_url = lcd->previous_url; details_ptr->previous_url = lcd->previous_url;
details_ptr->is_in_page = lcd->is_in_page; details_ptr->is_in_page = lcd->is_same_document;
details_ptr->is_main_frame = lcd->is_main_frame; details_ptr->is_main_frame = lcd->is_main_frame;
details_ptr->http_status_code = lcd->http_status_code; details_ptr->http_status_code = lcd->http_status_code;
client_->NavigationCommitted( client_->NavigationCommitted(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment