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

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

Issue 2781383002: Followup comments from r460581. (Closed)
Patch Set: 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 1403 matching lines...) Expand 10 before | Expand all | Expand 10 after
1414 1414
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 // TODO(nasko): it's confusing that this method, per comments and tests that
1425 // depend on this behavior, needs to check unload handlers as well.
1424 return WillNotifyDisconnection() && !ShowingInterstitialPage() && 1426 return WillNotifyDisconnection() && !ShowingInterstitialPage() &&
1425 !GetRenderViewHost()->SuddenTerminationAllowed() && 1427 !GetRenderViewHost()->SuddenTerminationAllowed() &&
1426 (GetMainFrame()->ShouldDispatchBeforeUnload() || 1428 (GetMainFrame()->ShouldDispatchBeforeUnload() ||
1427 GetMainFrame()->ShouldDispatchUnload()); 1429 GetMainFrame()->HasUnloadHandler());
1428 } 1430 }
1429 1431
1430 void WebContentsImpl::DispatchBeforeUnload() { 1432 void WebContentsImpl::DispatchBeforeUnload() {
1431 bool for_cross_site_transition = false; 1433 bool for_cross_site_transition = false;
1432 GetMainFrame()->DispatchBeforeUnload(for_cross_site_transition, false); 1434 GetMainFrame()->DispatchBeforeUnload(for_cross_site_transition, false);
1433 } 1435 }
1434 1436
1435 void WebContentsImpl::AttachToOuterWebContentsFrame( 1437 void WebContentsImpl::AttachToOuterWebContentsFrame(
1436 WebContents* outer_web_contents, 1438 WebContents* outer_web_contents,
1437 RenderFrameHost* outer_contents_frame) { 1439 RenderFrameHost* outer_contents_frame) {
(...skipping 3975 matching lines...) Expand 10 before | Expand all | Expand 10 after
5413 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host); 5415 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host);
5414 if (!render_view_host) 5416 if (!render_view_host)
5415 continue; 5417 continue;
5416 render_view_host_set.insert(render_view_host); 5418 render_view_host_set.insert(render_view_host);
5417 } 5419 }
5418 for (RenderViewHost* render_view_host : render_view_host_set) 5420 for (RenderViewHost* render_view_host : render_view_host_set)
5419 render_view_host->OnWebkitPreferencesChanged(); 5421 render_view_host->OnWebkitPreferencesChanged();
5420 } 5422 }
5421 5423
5422 } // namespace content 5424 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698