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

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

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.h
diff --git a/content/browser/renderer_host/render_view_host_impl.h b/content/browser/renderer_host/render_view_host_impl.h
index bee7b78c0e59e67bdb9195bca8fe37e77b78dfb7..1eeb4fec0604d3466c69c098b7dd845a65340bac 100644
--- a/content/browser/renderer_host/render_view_host_impl.h
+++ b/content/browser/renderer_host/render_view_host_impl.h
@@ -277,6 +277,13 @@ class CONTENT_EXPORT RenderViewHostImpl
// RenderViewHost.
void CancelSuspendedNavigations();
+ // Whether the initial empty page of this view has been accessed by another
+ // page, making it unsafe to show the pending URL. Always false after the
+ // first commit.
+ bool has_accessed_initial_document() {
+ return has_accessed_initial_document_;
+ }
+
// Whether this RenderViewHost has been swapped out to be displayed by a
// different process.
bool is_swapped_out() const { return is_swapped_out_; }
@@ -561,6 +568,7 @@ class CONTENT_EXPORT RenderViewHostImpl
const ShowDesktopNotificationHostMsgParams& params);
void OnCancelDesktopNotification(int notification_id);
void OnRunFileChooser(const FileChooserParams& params);
+ void OnDidAccessInitialDocument();
void OnDomOperationResponse(const std::string& json_string,
int automation_id);
void OnGetWindowSnapshot(const int snapshot_id);
@@ -622,6 +630,12 @@ class CONTENT_EXPORT RenderViewHostImpl
// a new one if a second navigation occurs.
scoped_ptr<ViewMsg_Navigate_Params> suspended_nav_params_;
+ // Whether the initial empty page of this view has been accessed by another
+ // page, making it unsafe to show the pending URL. Usually false unless
+ // another window tries to modify the blank page. Always false after the
+ // first commit.
+ bool has_accessed_initial_document_;
+
// Whether this RenderViewHost is currently swapped out, such that the view is
// being rendered by another process.
bool is_swapped_out_;
« no previous file with comments | « content/browser/renderer_host/render_view_host_delegate.h ('k') | content/browser/renderer_host/render_view_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698