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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 2832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2843 } | 2843 } |
2844 | 2844 |
2845 void WebContentsImpl::RenderViewTerminated(RenderViewHost* rvh, | 2845 void WebContentsImpl::RenderViewTerminated(RenderViewHost* rvh, |
2846 base::TerminationStatus status, | 2846 base::TerminationStatus status, |
2847 int error_code) { | 2847 int error_code) { |
2848 if (rvh != GetRenderViewHost()) { | 2848 if (rvh != GetRenderViewHost()) { |
2849 // The pending page's RenderViewHost is gone. | 2849 // The pending page's RenderViewHost is gone. |
2850 return; | 2850 return; |
2851 } | 2851 } |
2852 | 2852 |
| 2853 // Cancel any visible dialogs so they are not left dangling over the sad tab. |
| 2854 if (dialog_manager_) |
| 2855 dialog_manager_->CancelActiveAndPendingDialogs(this); |
| 2856 |
2853 ClearPowerSaveBlockers(rvh); | 2857 ClearPowerSaveBlockers(rvh); |
2854 SetIsLoading(rvh, false, NULL); | 2858 SetIsLoading(rvh, false, NULL); |
2855 NotifyDisconnected(); | 2859 NotifyDisconnected(); |
2856 SetIsCrashed(status, error_code); | 2860 SetIsCrashed(status, error_code); |
2857 GetView()->OnTabCrashed(GetCrashedStatus(), crashed_error_code_); | 2861 GetView()->OnTabCrashed(GetCrashedStatus(), crashed_error_code_); |
2858 | 2862 |
2859 FOR_EACH_OBSERVER(WebContentsObserver, | 2863 FOR_EACH_OBSERVER(WebContentsObserver, |
2860 observers_, | 2864 observers_, |
2861 RenderProcessGone(GetCrashedStatus())); | 2865 RenderProcessGone(GetCrashedStatus())); |
2862 } | 2866 } |
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3658 | 3662 |
3659 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { | 3663 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { |
3660 if (!delegate_) | 3664 if (!delegate_) |
3661 return; | 3665 return; |
3662 const gfx::Size new_size = GetPreferredSize(); | 3666 const gfx::Size new_size = GetPreferredSize(); |
3663 if (new_size != old_size) | 3667 if (new_size != old_size) |
3664 delegate_->UpdatePreferredSize(this, new_size); | 3668 delegate_->UpdatePreferredSize(this, new_size); |
3665 } | 3669 } |
3666 | 3670 |
3667 } // namespace content | 3671 } // namespace content |
OLD | NEW |