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/render_view_host_manager.h" | 5 #include "content/browser/web_contents/render_view_host_manager.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 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 RenderViewHostImpl* old_render_view_host = render_view_host_; | 741 RenderViewHostImpl* old_render_view_host = render_view_host_; |
742 render_view_host_ = pending_render_view_host_; | 742 render_view_host_ = pending_render_view_host_; |
743 pending_render_view_host_ = NULL; | 743 pending_render_view_host_ = NULL; |
744 | 744 |
745 // The process will no longer try to exit, so we can decrement the count. | 745 // The process will no longer try to exit, so we can decrement the count. |
746 render_view_host_->GetProcess()->RemovePendingView(); | 746 render_view_host_->GetProcess()->RemovePendingView(); |
747 | 747 |
748 // If the view is gone, then this RenderViewHost died while it was hidden. | 748 // If the view is gone, then this RenderViewHost died while it was hidden. |
749 // We ignored the RenderProcessGone call at the time, so we should send it now | 749 // We ignored the RenderProcessGone call at the time, so we should send it now |
750 // to make sure the sad tab shows up, etc. | 750 // to make sure the sad tab shows up, etc. |
751 if (render_view_host_->GetView()) | 751 if (!render_view_host_->GetView()) |
| 752 delegate_->RenderProcessGoneFromRenderManager(render_view_host_); |
| 753 else if (!delegate_->IsHidden()) |
752 render_view_host_->GetView()->Show(); | 754 render_view_host_->GetView()->Show(); |
753 else | |
754 delegate_->RenderProcessGoneFromRenderManager(render_view_host_); | |
755 | 755 |
756 // Hide the old view now that the new one is visible. | 756 // Hide the old view now that the new one is visible. |
757 if (old_render_view_host->GetView()) { | 757 if (old_render_view_host->GetView()) { |
758 old_render_view_host->GetView()->Hide(); | 758 old_render_view_host->GetView()->Hide(); |
759 old_render_view_host->WasSwappedOut(); | 759 old_render_view_host->WasSwappedOut(); |
760 } | 760 } |
761 | 761 |
762 // Make sure the size is up to date. (Fix for bug 1079768.) | 762 // Make sure the size is up to date. (Fix for bug 1079768.) |
763 delegate_->UpdateRenderViewSizeForRenderManager(); | 763 delegate_->UpdateRenderViewSizeForRenderManager(); |
764 | 764 |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1045 RenderViewHostImpl* RenderViewHostManager::GetSwappedOutRenderViewHost( | 1045 RenderViewHostImpl* RenderViewHostManager::GetSwappedOutRenderViewHost( |
1046 SiteInstance* instance) { | 1046 SiteInstance* instance) { |
1047 RenderViewHostMap::iterator iter = swapped_out_hosts_.find(instance->GetId()); | 1047 RenderViewHostMap::iterator iter = swapped_out_hosts_.find(instance->GetId()); |
1048 if (iter != swapped_out_hosts_.end()) | 1048 if (iter != swapped_out_hosts_.end()) |
1049 return iter->second; | 1049 return iter->second; |
1050 | 1050 |
1051 return NULL; | 1051 return NULL; |
1052 } | 1052 } |
1053 | 1053 |
1054 } // namespace content | 1054 } // namespace content |
OLD | NEW |