summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorerikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-10 19:34:43 +0000
committererikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-10 19:34:43 +0000
commit0578a5011ceff5a50c9e2905d48d5747cf72569b (patch)
tree383666ae6cf1e977c53ba85d81ac98095beb7e81 /chrome
parent297117029c8cd44b92d8529bc9b29eeb8e5fffb9 (diff)
downloadchromium_src-0578a5011ceff5a50c9e2905d48d5747cf72569b.zip
chromium_src-0578a5011ceff5a50c9e2905d48d5747cf72569b.tar.gz
chromium_src-0578a5011ceff5a50c9e2905d48d5747cf72569b.tar.bz2
Change old code from "unloadListnerChanged" model to new WebKit EnableSuddenTermination, unforking a bunch of code.
BUG=http://crbug.com/4064 Review URL: http://codereview.chromium.org/9746 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5116 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/renderer/render_view.cc24
-rw-r--r--chrome/renderer/render_view.h3
2 files changed, 8 insertions, 19 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index cbae9d0..66a5092 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -1647,24 +1647,12 @@ bool RenderView::RunBeforeUnloadConfirm(WebView* webview,
return success;
}
-void RenderView::OnUnloadListenerChanged(WebView* webview, WebFrame* webframe) {
- bool has_listener = false;
- if (!has_unload_listener_) {
- has_listener = webframe->HasUnloadListener();
- } else {
- WebFrame* frame = webview->GetMainFrame();
- while (frame != NULL) {
- if (frame->HasUnloadListener()) {
- has_listener = true;
- break;
- }
- frame = webview->GetNextFrameAfter(frame, false);
- }
- }
- if (has_listener != has_unload_listener_) {
- has_unload_listener_ = has_listener;
- Send(new ViewHostMsg_UnloadListenerChanged(routing_id_, has_listener));
- }
+void RenderView::EnableSuddenTermination() {
+ Send(new ViewHostMsg_UnloadListenerChanged(routing_id_, false));
+}
+
+void RenderView::DisableSuddenTermination() {
+ Send(new ViewHostMsg_UnloadListenerChanged(routing_id_, true));
}
void RenderView::QueryFormFieldAutofill(const std::wstring& field_name,
diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h
index 8484afd..3006448 100644
--- a/chrome/renderer/render_view.h
+++ b/chrome/renderer/render_view.h
@@ -126,7 +126,8 @@ class RenderView : public RenderWidget, public WebViewDelegate,
std::wstring* result);
virtual bool RunBeforeUnloadConfirm(WebView* webview,
const std::wstring& message);
- virtual void OnUnloadListenerChanged(WebView* webview, WebFrame* webframe);
+ virtual void EnableSuddenTermination();
+ virtual void DisableSuddenTermination();
virtual void QueryFormFieldAutofill(const std::wstring& field_name,
const std::wstring& text,
int64 node_id);