From 2fc22d1b31c3ec41393370a35ee76ba54e514bd1 Mon Sep 17 00:00:00 2001 From: "ananta@chromium.org" Date: Thu, 2 Dec 2010 23:08:16 +0000 Subject: Add support for displaying the repost warning data in ChromeFrame when the user attempts to reload a ChromeFrame page which was received as a result of a top level form post. We should also not be treating form resubmits as top level navigations being routed back to the host browser as this nullifies the effect of the form post. Fixes portions of bug http://code.google.com/p/chromium/issues/detail?id=64901 BUG=64901 TEST=Navigate to the url mentioned in the bug in ChromeFrame and on posting the form hit F5. This should put up a confirmation dialog and on accepting it should display the expected values on the page. Review URL: http://codereview.chromium.org/5530001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68097 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/external_tab_container_win.cc | 6 ++++++ chrome/browser/external_tab_container_win.h | 2 ++ chrome/renderer/render_view.cc | 3 ++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/chrome/browser/external_tab_container_win.cc b/chrome/browser/external_tab_container_win.cc index f254816..2c2ae78 100644 --- a/chrome/browser/external_tab_container_win.cc +++ b/chrome/browser/external_tab_container_win.cc @@ -29,6 +29,7 @@ #include "chrome/browser/renderer_host/resource_dispatcher_host_request_info.h" #include "chrome/browser/tab_contents/provisional_load_details.h" #include "chrome/browser/tab_contents/tab_contents.h" +#include "chrome/browser/views/browser_dialogs.h" #include "chrome/browser/views/page_info_bubble_view.h" #include "chrome/browser/views/tab_contents/render_view_context_menu_views.h" #include "chrome/browser/views/tab_contents/tab_contents_container.h" @@ -702,6 +703,11 @@ void ExternalTabContainer::BeforeUnloadFired(TabContents* tab, } } +void ExternalTabContainer::ShowRepostFormWarningDialog( + TabContents* tab_contents) { + browser::ShowRepostFormWarningDialog(GetNativeView(), tab_contents); +} + //////////////////////////////////////////////////////////////////////////////// // ExternalTabContainer, NotificationObserver implementation: diff --git a/chrome/browser/external_tab_container_win.h b/chrome/browser/external_tab_container_win.h index cc0e35c..9821c4b 100644 --- a/chrome/browser/external_tab_container_win.h +++ b/chrome/browser/external_tab_container_win.h @@ -173,6 +173,8 @@ class ExternalTabContainer : public TabContentsDelegate, bool proceed, bool* proceed_to_fire_unload); + void ShowRepostFormWarningDialog(TabContents* tab_contents); + // Overriden from TabContentsDelegate::AutomationResourceRoutingDelegate virtual void RegisterRenderViewHost(RenderViewHost* render_view_host); virtual void UnregisterRenderViewHost(RenderViewHost* render_view_host); diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index c900173..d3fe814 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -5621,9 +5621,10 @@ bool RenderView::IsNonLocalTopLevelNavigation( if (!url.SchemeIs("http") && !url.SchemeIs("https")) return false; - // Not interested in reloads. + // Not interested in reloads/form submits/resubmits/back forward navigations. if (type != WebKit::WebNavigationTypeReload && type != WebKit::WebNavigationTypeFormSubmitted && + type != WebKit::WebNavigationTypeFormResubmitted && type != WebKit::WebNavigationTypeBackForward) { // The opener relationship between the new window and the parent allows the // new window to script the parent and vice versa. This is not allowed if -- cgit v1.1