From e2eb8af4c96ce74c1ce1773fd2d94b1f16effe36 Mon Sep 17 00:00:00 2001 From: "creis@chromium.org" Date: Mon, 21 Apr 2014 19:41:30 +0000 Subject: Don't leave aborted URLs in the omnibox unless we're on the NTP. BUG=355537 TEST=See bug for repro steps. Review URL: https://codereview.chromium.org/232463007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@265044 0039d316-1c4b-4281-b951-d872f2087c98 --- content/public/browser/web_contents_delegate.cc | 4 ++++ content/public/browser/web_contents_delegate.h | 5 +++++ 2 files changed, 9 insertions(+) (limited to 'content/public') diff --git a/content/public/browser/web_contents_delegate.cc b/content/public/browser/web_contents_delegate.cc index 22430da..5346c2a 100644 --- a/content/public/browser/web_contents_delegate.cc +++ b/content/public/browser/web_contents_delegate.cc @@ -37,6 +37,10 @@ bool WebContentsDelegate::ShouldSuppressDialogs() { return false; } +bool WebContentsDelegate::ShouldPreserveAbortedURLs(WebContents* source) { + return false; +} + bool WebContentsDelegate::AddMessageToConsole(WebContents* source, int32 level, const base::string16& message, diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h index 0210314..d22d7c7 100644 --- a/content/public/browser/web_contents_delegate.h +++ b/content/public/browser/web_contents_delegate.h @@ -173,6 +173,11 @@ class CONTENT_EXPORT WebContentsDelegate { // Default is false. virtual bool ShouldSuppressDialogs(); + // Returns whether pending NavigationEntries for aborted browser-initiated + // navigations should be preserved (and thus returned from GetVisibleURL). + // Defaults to false. + virtual bool ShouldPreserveAbortedURLs(WebContents* source); + // Add a message to the console. Returning true indicates that the delegate // handled the message. If false is returned the default logging mechanism // will be used for the message. -- cgit v1.1