Commit 944074f2 authored by avi@chromium.org's avatar avi@chromium.org

Move dispatchBeforeUnloadEvent to WebFrame, part 2/3.

BUG=357782
TEST=no change

Review URL: https://codereview.chromium.org/216793014

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260463 0039d316-1c4b-4281-b951-d872f2087c98
parent 0dada41e
...@@ -779,13 +779,13 @@ void RenderFrameImpl::OnNavigate(const FrameMsg_Navigate_Params& params) { ...@@ -779,13 +779,13 @@ void RenderFrameImpl::OnNavigate(const FrameMsg_Navigate_Params& params) {
} }
void RenderFrameImpl::OnBeforeUnload() { void RenderFrameImpl::OnBeforeUnload() {
// TODO(creis): Move dispatchBeforeUnloadEvent to WebFrame. Until then, this // TODO(creis): Right now, this is only called on the main frame. Make the
// should only be called on the main frame. Eventually, the browser process // browser process send dispatchBeforeUnloadEvent to every frame that needs
// should dispatch it to every frame that needs it. // it.
CHECK(!frame_->parent()); CHECK(!frame_->parent());
base::TimeTicks before_unload_start_time = base::TimeTicks::Now(); base::TimeTicks before_unload_start_time = base::TimeTicks::Now();
bool proceed = render_view_->webview()->dispatchBeforeUnloadEvent(); bool proceed = frame_->dispatchBeforeUnloadEvent();
base::TimeTicks before_unload_end_time = base::TimeTicks::Now(); base::TimeTicks before_unload_end_time = base::TimeTicks::Now();
Send(new FrameHostMsg_BeforeUnload_ACK(routing_id_, proceed, Send(new FrameHostMsg_BeforeUnload_ACK(routing_id_, proceed,
before_unload_start_time, before_unload_start_time,
......
...@@ -1933,7 +1933,7 @@ bool TestRunner::IsCommandEnabled(const std::string& command) { ...@@ -1933,7 +1933,7 @@ bool TestRunner::IsCommandEnabled(const std::string& command) {
} }
bool TestRunner::CallShouldCloseOnWebView() { bool TestRunner::CallShouldCloseOnWebView() {
return web_view_->dispatchBeforeUnloadEvent(); return web_view_->mainFrame()->dispatchBeforeUnloadEvent();
} }
void TestRunner::SetDomainRelaxationForbiddenForURLScheme( void TestRunner::SetDomainRelaxationForbiddenForURLScheme(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment