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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 2812743002: Revert of Keep track in the browser of which frames have onunload and onbeforeunload handlers. (Closed)
Patch Set: manual merge Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 #include <utility> 10 #include <utility>
(...skipping 1404 matching lines...) Expand 10 before | Expand all | Expand 10 after
1415 void WebContentsImpl::WasUnOccluded() { 1415 void WebContentsImpl::WasUnOccluded() {
1416 for (RenderWidgetHostView* view : GetRenderWidgetHostViewsInTree()) { 1416 for (RenderWidgetHostView* view : GetRenderWidgetHostViewsInTree()) {
1417 if (view) 1417 if (view)
1418 view->WasUnOccluded(); 1418 view->WasUnOccluded();
1419 } 1419 }
1420 } 1420 }
1421 1421
1422 bool WebContentsImpl::NeedToFireBeforeUnload() { 1422 bool WebContentsImpl::NeedToFireBeforeUnload() {
1423 // TODO(creis): Should we fire even for interstitial pages? 1423 // TODO(creis): Should we fire even for interstitial pages?
1424 return WillNotifyDisconnection() && !ShowingInterstitialPage() && 1424 return WillNotifyDisconnection() && !ShowingInterstitialPage() &&
1425 !GetRenderViewHost()->SuddenTerminationAllowed() && 1425 !GetRenderViewHost()->SuddenTerminationAllowed();
1426 (GetMainFrame()->ShouldDispatchBeforeUnload() ||
1427 GetMainFrame()->ShouldDispatchUnload());
1428 } 1426 }
1429 1427
1430 void WebContentsImpl::DispatchBeforeUnload() { 1428 void WebContentsImpl::DispatchBeforeUnload() {
1431 bool for_cross_site_transition = false; 1429 bool for_cross_site_transition = false;
1432 GetMainFrame()->DispatchBeforeUnload(for_cross_site_transition, false); 1430 GetMainFrame()->DispatchBeforeUnload(for_cross_site_transition, false);
1433 } 1431 }
1434 1432
1435 void WebContentsImpl::AttachToOuterWebContentsFrame( 1433 void WebContentsImpl::AttachToOuterWebContentsFrame(
1436 WebContents* outer_web_contents, 1434 WebContents* outer_web_contents,
1437 RenderFrameHost* outer_contents_frame) { 1435 RenderFrameHost* outer_contents_frame) {
(...skipping 3980 matching lines...) Expand 10 before | Expand all | Expand 10 after
5418 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host); 5416 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host);
5419 if (!render_view_host) 5417 if (!render_view_host)
5420 continue; 5418 continue;
5421 render_view_host_set.insert(render_view_host); 5419 render_view_host_set.insert(render_view_host);
5422 } 5420 }
5423 for (RenderViewHost* render_view_host : render_view_host_set) 5421 for (RenderViewHost* render_view_host : render_view_host_set)
5424 render_view_host->OnWebkitPreferencesChanged(); 5422 render_view_host->OnWebkitPreferencesChanged();
5425 } 5423 }
5426 5424
5427 } // namespace content 5425 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698