OLD | NEW |
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 Loading... |
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 3975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5413 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host); | 5411 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host); |
5414 if (!render_view_host) | 5412 if (!render_view_host) |
5415 continue; | 5413 continue; |
5416 render_view_host_set.insert(render_view_host); | 5414 render_view_host_set.insert(render_view_host); |
5417 } | 5415 } |
5418 for (RenderViewHost* render_view_host : render_view_host_set) | 5416 for (RenderViewHost* render_view_host : render_view_host_set) |
5419 render_view_host->OnWebkitPreferencesChanged(); | 5417 render_view_host->OnWebkitPreferencesChanged(); |
5420 } | 5418 } |
5421 | 5419 |
5422 } // namespace content | 5420 } // namespace content |
OLD | NEW |