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

Unified Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 14283005: Allow showing pending URL for new tab navigations, but only if safe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 7 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/renderer_host/render_view_host_impl.cc
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
index e6b59ba8abb922903a1c9cbddc7e9545e1f238bc..dcf7774b657e92a975b556eec43c665a244c01bc 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -170,6 +170,7 @@ RenderViewHostImpl::RenderViewHostImpl(
pending_request_id_(-1),
navigations_suspended_(false),
suspended_nav_params_(NULL),
+ has_accessed_initial_document_(false),
is_swapped_out_(swapped_out),
is_subframe_(false),
main_frame_id_(-1),
@@ -999,6 +1000,8 @@ bool RenderViewHostImpl::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(ViewHostMsg_ShowPopup, OnShowPopup)
#endif
IPC_MESSAGE_HANDLER(ViewHostMsg_RunFileChooser, OnRunFileChooser)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_DidAccessInitialDocument,
+ OnDidAccessInitialDocument)
IPC_MESSAGE_HANDLER(ViewHostMsg_DomOperationResponse,
OnDomOperationResponse)
IPC_MESSAGE_HANDLER(AccessibilityHostMsg_Notifications,
@@ -1222,6 +1225,10 @@ void RenderViewHostImpl::OnNavigate(const IPC::Message& msg) {
process->ReceivedBadMessage();
}
+ // Now that something has committed, we don't need to track whether the
+ // initial page has been accessed.
+ has_accessed_initial_document_ = false;
+
ChildProcessSecurityPolicyImpl* policy =
ChildProcessSecurityPolicyImpl::GetInstance();
// Without this check, an evil renderer can trick the browser into creating
@@ -2018,6 +2025,11 @@ void RenderViewHostImpl::OnRunFileChooser(const FileChooserParams& params) {
delegate_->RunFileChooser(this, params);
}
+void RenderViewHostImpl::OnDidAccessInitialDocument() {
+ has_accessed_initial_document_ = true;
+ delegate_->DidAccessInitialDocument();
+}
+
void RenderViewHostImpl::OnDomOperationResponse(
const std::string& json_string, int automation_id) {
DomOperationNotificationDetails details(json_string, automation_id);

Powered by Google App Engine
This is Rietveld 408576698