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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 251823002: Move didAccessInitialDocument to RenderFrame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: commentary Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index bddc8de7b9cea9a3582fc124fc4cb921a73d0f2d..21ccfaae8f655669475e4975694f5f160dfbc5da 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -335,6 +335,7 @@ WebContentsImpl::WebContentsImpl(
upload_size_(0),
upload_position_(0),
displayed_insecure_content_(false),
+ has_accessed_initial_document_(false),
capturer_count_(0),
should_normally_be_visible_(true),
is_being_destroyed_(false),
@@ -2465,6 +2466,10 @@ void WebContentsImpl::DidNavigateAnyFramePostCommit(
RenderFrameHostImpl* render_frame_host,
const LoadCommittedDetails& details,
const FrameHostMsg_DidCommitProvisionalLoad_Params& params) {
+ // Now that something has committed, we don't need to track whether the
+ // initial page has been accessed.
+ has_accessed_initial_document_ = false;
+
// If we navigate off the page, close all JavaScript dialogs.
if (dialog_manager_ && !details.is_in_page)
dialog_manager_->CancelActiveAndPendingDialogs(this);
@@ -2851,6 +2856,10 @@ void WebContentsImpl::ActivateAndShowRepostFormWarningDialog() {
delegate_->ShowRepostFormWarningDialog(this);
}
+bool WebContentsImpl::HasAccessedInitialDocument() {
+ return has_accessed_initial_document_;
+}
+
// Notifies the RenderWidgetHost instance about the fact that the page is
// loading, or done loading.
void WebContentsImpl::SetIsLoading(RenderViewHost* render_view_host,
@@ -3414,6 +3423,8 @@ void WebContentsImpl::DidDisownOpener(RenderViewHost* rvh) {
}
void WebContentsImpl::DidAccessInitialDocument() {
+ has_accessed_initial_document_ = true;
+
// We may have left a failed browser-initiated navigation in the address bar
// to let the user edit it and try again. Clear it now that content might
// show up underneath it.

Powered by Google App Engine
This is Rietveld 408576698