| 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/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 1656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1667 | 1667 |
| 1668 #if defined(OS_ANDROID) | 1668 #if defined(OS_ANDROID) |
| 1669 ContentVideoView* video_view = ContentVideoView::GetInstance(); | 1669 ContentVideoView* video_view = ContentVideoView::GetInstance(); |
| 1670 if (video_view != NULL) | 1670 if (video_view != NULL) |
| 1671 video_view->OnExitFullscreen(); | 1671 video_view->OnExitFullscreen(); |
| 1672 #endif | 1672 #endif |
| 1673 | 1673 |
| 1674 if (delegate_) | 1674 if (delegate_) |
| 1675 delegate_->ExitFullscreenModeForTab(this); | 1675 delegate_->ExitFullscreenModeForTab(this); |
| 1676 | 1676 |
| 1677 // Ensure web contents exit fullscreen state by sending a resize message, | |
| 1678 // which includes the fullscreen state. This is required for the situation | |
| 1679 // of the browser moving the view into a fullscreen state "browser fullscreen" | |
| 1680 // and then the contents entering "tab fullscreen". Exiting the contents | |
| 1681 // "tab fullscreen" then won't have the side effect of the view resizing, | |
| 1682 // hence the explicit call here is required. | |
| 1683 if (RenderWidgetHostView* rwh_view = GetRenderWidgetHostView()) { | |
| 1684 if (RenderWidgetHost* render_widget_host = rwh_view->GetRenderWidgetHost()) | |
| 1685 render_widget_host->WasResized(); | |
| 1686 } | |
| 1687 | |
| 1688 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 1677 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
| 1689 DidToggleFullscreenModeForTab(IsFullscreenForCurrentTab( | 1678 DidToggleFullscreenModeForTab(IsFullscreenForCurrentTab( |
| 1690 GetRenderViewHost()->GetWidget()))); | 1679 GetRenderViewHost()->GetWidget()))); |
| 1691 } | 1680 } |
| 1692 | 1681 |
| 1693 bool WebContentsImpl::IsFullscreenForCurrentTab( | 1682 bool WebContentsImpl::IsFullscreenForCurrentTab( |
| 1694 RenderWidgetHostImpl* render_widget_host) const { | 1683 RenderWidgetHostImpl* render_widget_host) const { |
| 1695 if (!RenderViewHostImpl::From(render_widget_host)) | 1684 if (!RenderViewHostImpl::From(render_widget_host)) |
| 1696 return false; | 1685 return false; |
| 1697 | 1686 |
| (...skipping 3109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4807 return NULL; | 4796 return NULL; |
| 4808 } | 4797 } |
| 4809 | 4798 |
| 4810 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4799 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
| 4811 force_disable_overscroll_content_ = force_disable; | 4800 force_disable_overscroll_content_ = force_disable; |
| 4812 if (view_) | 4801 if (view_) |
| 4813 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4802 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
| 4814 } | 4803 } |
| 4815 | 4804 |
| 4816 } // namespace content | 4805 } // namespace content |
| OLD | NEW |