| 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 3648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3659 // TODO(brettw) this is a hack. See WebContentsView::SizeContents. | 3659 // TODO(brettw) this is a hack. See WebContentsView::SizeContents. |
| 3660 gfx::Size size = GetSizeForNewRenderView(); | 3660 gfx::Size size = GetSizeForNewRenderView(); |
| 3661 // 0x0 isn't a valid window size (minimal window size is 1x1) but it may be | 3661 // 0x0 isn't a valid window size (minimal window size is 1x1) but it may be |
| 3662 // here during container initialization and normal window size will be set | 3662 // here during container initialization and normal window size will be set |
| 3663 // later. In case of tab duplication this resizing to 0x0 prevents setting | 3663 // later. In case of tab duplication this resizing to 0x0 prevents setting |
| 3664 // normal size later so just ignore it. | 3664 // normal size later so just ignore it. |
| 3665 if (!size.IsEmpty()) | 3665 if (!size.IsEmpty()) |
| 3666 view_->SizeContents(size); | 3666 view_->SizeContents(size); |
| 3667 } | 3667 } |
| 3668 | 3668 |
| 3669 void WebContentsImpl::CancelModalDialogsForRenderManager() { |
| 3670 // We need to cancel modal dialogs when doing a process swap, since the load |
| 3671 // deferrer would prevent us from swapping out. |
| 3672 if (dialog_manager_) |
| 3673 dialog_manager_->CancelActiveAndPendingDialogs(this); |
| 3674 } |
| 3675 |
| 3669 void WebContentsImpl::NotifySwappedFromRenderManager(RenderViewHost* rvh) { | 3676 void WebContentsImpl::NotifySwappedFromRenderManager(RenderViewHost* rvh) { |
| 3670 NotifySwapped(rvh); | 3677 NotifySwapped(rvh); |
| 3671 | 3678 |
| 3672 // Make sure the visible RVH reflects the new delegate's preferences. | 3679 // Make sure the visible RVH reflects the new delegate's preferences. |
| 3673 if (delegate_) | 3680 if (delegate_) |
| 3674 view_->SetOverscrollControllerEnabled(delegate_->CanOverscrollContent()); | 3681 view_->SetOverscrollControllerEnabled(delegate_->CanOverscrollContent()); |
| 3675 | 3682 |
| 3676 view_->RenderViewSwappedIn(render_manager_.current_host()); | 3683 view_->RenderViewSwappedIn(render_manager_.current_host()); |
| 3677 | 3684 |
| 3678 FrameTreeNode* root = NULL; | 3685 FrameTreeNode* root = NULL; |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3859 gfx::Size WebContentsImpl::GetSizeForNewRenderView() const { | 3866 gfx::Size WebContentsImpl::GetSizeForNewRenderView() const { |
| 3860 gfx::Size size; | 3867 gfx::Size size; |
| 3861 if (delegate_) | 3868 if (delegate_) |
| 3862 size = delegate_->GetSizeForNewRenderView(this); | 3869 size = delegate_->GetSizeForNewRenderView(this); |
| 3863 if (size.IsEmpty()) | 3870 if (size.IsEmpty()) |
| 3864 size = view_->GetContainerSize(); | 3871 size = view_->GetContainerSize(); |
| 3865 return size; | 3872 return size; |
| 3866 } | 3873 } |
| 3867 | 3874 |
| 3868 } // namespace content | 3875 } // namespace content |
| OLD | NEW |