| 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 2989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3000 view_->CloseTabAfterEventTracking(); | 3000 view_->CloseTabAfterEventTracking(); |
| 3001 return; | 3001 return; |
| 3002 } | 3002 } |
| 3003 #endif | 3003 #endif |
| 3004 | 3004 |
| 3005 // Ignore this if it comes from a RenderViewHost that we aren't showing. | 3005 // Ignore this if it comes from a RenderViewHost that we aren't showing. |
| 3006 if (delegate_ && rvh == GetRenderViewHost()) | 3006 if (delegate_ && rvh == GetRenderViewHost()) |
| 3007 delegate_->CloseContents(this); | 3007 delegate_->CloseContents(this); |
| 3008 } | 3008 } |
| 3009 | 3009 |
| 3010 void WebContentsImpl::SwappedOut(RenderViewHost* rvh) { | 3010 void WebContentsImpl::SwappedOut(RenderFrameHost* rfh) { |
| 3011 if (rvh == GetRenderViewHost()) { | 3011 // TODO(creis): Handle subframes that go fullscreen. |
| 3012 if (rfh->GetRenderViewHost() == GetRenderViewHost()) { |
| 3012 // Exit fullscreen mode before the current RVH is swapped out. For numerous | 3013 // Exit fullscreen mode before the current RVH is swapped out. For numerous |
| 3013 // cases, there is no guarantee the renderer would/could initiate an exit. | 3014 // cases, there is no guarantee the renderer would/could initiate an exit. |
| 3014 // Example: http://crbug.com/347232 | 3015 // Example: http://crbug.com/347232 |
| 3015 if (IsFullscreenForCurrentTab()) { | 3016 if (IsFullscreenForCurrentTab()) { |
| 3016 if (rvh) | 3017 rfh->GetRenderViewHost()->ExitFullscreen(); |
| 3017 rvh->ExitFullscreen(); | |
| 3018 DCHECK(!IsFullscreenForCurrentTab()); | 3018 DCHECK(!IsFullscreenForCurrentTab()); |
| 3019 } | 3019 } |
| 3020 | 3020 |
| 3021 if (delegate_) | 3021 if (delegate_) |
| 3022 delegate_->SwappedOut(this); | 3022 delegate_->SwappedOut(this); |
| 3023 } | 3023 } |
| 3024 | |
| 3025 // Allow the navigation to proceed. | |
| 3026 GetRenderManager()->SwappedOut(rvh); | |
| 3027 } | 3024 } |
| 3028 | 3025 |
| 3029 void WebContentsImpl::RequestMove(const gfx::Rect& new_bounds) { | 3026 void WebContentsImpl::RequestMove(const gfx::Rect& new_bounds) { |
| 3030 if (delegate_ && delegate_->IsPopupOrPanel(this)) | 3027 if (delegate_ && delegate_->IsPopupOrPanel(this)) |
| 3031 delegate_->MoveContents(this, new_bounds); | 3028 delegate_->MoveContents(this, new_bounds); |
| 3032 } | 3029 } |
| 3033 | 3030 |
| 3034 void WebContentsImpl::DidStartLoading(RenderFrameHost* render_frame_host) { | 3031 void WebContentsImpl::DidStartLoading(RenderFrameHost* render_frame_host) { |
| 3035 SetIsLoading(render_frame_host->GetRenderViewHost(), true, NULL); | 3032 SetIsLoading(render_frame_host->GetRenderViewHost(), true, NULL); |
| 3036 } | 3033 } |
| (...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3630 | 3627 |
| 3631 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { | 3628 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { |
| 3632 if (!delegate_) | 3629 if (!delegate_) |
| 3633 return; | 3630 return; |
| 3634 const gfx::Size new_size = GetPreferredSize(); | 3631 const gfx::Size new_size = GetPreferredSize(); |
| 3635 if (new_size != old_size) | 3632 if (new_size != old_size) |
| 3636 delegate_->UpdatePreferredSize(this, new_size); | 3633 delegate_->UpdatePreferredSize(this, new_size); |
| 3637 } | 3634 } |
| 3638 | 3635 |
| 3639 } // namespace content | 3636 } // namespace content |
| OLD | NEW |