| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/frame_host/render_frame_host_manager.h" | 5 #include "content/browser/frame_host/render_frame_host_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 2137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2148 // If the view is gone, then this RenderViewHost died while it was hidden. | 2148 // If the view is gone, then this RenderViewHost died while it was hidden. |
| 2149 // We ignored the RenderProcessGone call at the time, so we should send it | 2149 // We ignored the RenderProcessGone call at the time, so we should send it |
| 2150 // now to make sure the sad tab shows up, etc. | 2150 // now to make sure the sad tab shows up, etc. |
| 2151 DCHECK(!render_frame_host_->IsRenderFrameLive()); | 2151 DCHECK(!render_frame_host_->IsRenderFrameLive()); |
| 2152 DCHECK(!render_frame_host_->render_view_host()->IsRenderViewLive()); | 2152 DCHECK(!render_frame_host_->render_view_host()->IsRenderViewLive()); |
| 2153 render_frame_host_->ResetLoadingState(); | 2153 render_frame_host_->ResetLoadingState(); |
| 2154 delegate_->RenderProcessGoneFromRenderManager( | 2154 delegate_->RenderProcessGoneFromRenderManager( |
| 2155 render_frame_host_->render_view_host()); | 2155 render_frame_host_->render_view_host()); |
| 2156 } | 2156 } |
| 2157 | 2157 |
| 2158 // For top-level frames, also hide the old RenderViewHost's view. |
| 2159 // TODO(creis): As long as show/hide are on RVH, we don't want to hide on |
| 2160 // subframe navigations or we will interfere with the top-level frame. |
| 2161 if (is_main_frame && |
| 2162 old_render_frame_host->render_view_host()->GetWidget()->GetView()) { |
| 2163 old_render_frame_host->render_view_host()->GetWidget()->GetView()->Hide(); |
| 2164 } |
| 2165 |
| 2158 // Make sure the size is up to date. (Fix for bug 1079768.) | 2166 // Make sure the size is up to date. (Fix for bug 1079768.) |
| 2159 delegate_->UpdateRenderViewSizeForRenderManager(); | 2167 delegate_->UpdateRenderViewSizeForRenderManager(); |
| 2160 | 2168 |
| 2161 if (will_focus_location_bar) { | 2169 if (will_focus_location_bar) { |
| 2162 delegate_->SetFocusToLocationBar(false); | 2170 delegate_->SetFocusToLocationBar(false); |
| 2163 } else if (focus_render_view && render_frame_host_->GetView()) { | 2171 } else if (focus_render_view && render_frame_host_->GetView()) { |
| 2164 if (is_main_frame) { | 2172 if (is_main_frame) { |
| 2165 render_frame_host_->GetView()->Focus(); | 2173 render_frame_host_->GetView()->Focus(); |
| 2166 } else { | 2174 } else { |
| 2167 // The main frame's view is already focused, but we need to set | 2175 // The main frame's view is already focused, but we need to set |
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2701 resolved_url)) { | 2709 resolved_url)) { |
| 2702 DCHECK(!dest_instance || | 2710 DCHECK(!dest_instance || |
| 2703 dest_instance == render_frame_host_->GetSiteInstance()); | 2711 dest_instance == render_frame_host_->GetSiteInstance()); |
| 2704 return false; | 2712 return false; |
| 2705 } | 2713 } |
| 2706 | 2714 |
| 2707 return true; | 2715 return true; |
| 2708 } | 2716 } |
| 2709 | 2717 |
| 2710 } // namespace content | 2718 } // namespace content |
| OLD | NEW |