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 1461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1472 | 1472 |
1473 #if defined(OS_ANDROID) | 1473 #if defined(OS_ANDROID) |
1474 ContentVideoView* video_view = ContentVideoView::GetInstance(); | 1474 ContentVideoView* video_view = ContentVideoView::GetInstance(); |
1475 if (video_view != NULL) | 1475 if (video_view != NULL) |
1476 video_view->OnExitFullscreen(); | 1476 video_view->OnExitFullscreen(); |
1477 #endif | 1477 #endif |
1478 | 1478 |
1479 if (delegate_) | 1479 if (delegate_) |
1480 delegate_->ExitFullscreenModeForTab(this); | 1480 delegate_->ExitFullscreenModeForTab(this); |
1481 | 1481 |
| 1482 // Ensure web contents exit fullscreen state by sending a resize message, |
| 1483 // which includes the fullscreen state. This is required for the situation |
| 1484 // of the browser moving the view into a fullscreen state "browser fullscreen" |
| 1485 // and then the contents entering "tab fullscreen". Exiting the contents |
| 1486 // "tab fullscreen" then won't have the side effect of the view resizing, |
| 1487 // hence the explicit call here is required. |
| 1488 if (RenderWidgetHostView* rwh_view = GetRenderWidgetHostView()) { |
| 1489 if (RenderWidgetHost* render_widget_host = rwh_view->GetRenderWidgetHost()) |
| 1490 render_widget_host->WasResized(); |
| 1491 } |
| 1492 |
1482 FOR_EACH_OBSERVER(WebContentsObserver, | 1493 FOR_EACH_OBSERVER(WebContentsObserver, |
1483 observers_, | 1494 observers_, |
1484 DidToggleFullscreenModeForTab(IsFullscreenForCurrentTab())); | 1495 DidToggleFullscreenModeForTab(IsFullscreenForCurrentTab())); |
1485 } | 1496 } |
1486 | 1497 |
1487 bool WebContentsImpl::IsFullscreenForCurrentTab() const { | 1498 bool WebContentsImpl::IsFullscreenForCurrentTab() const { |
1488 return delegate_ ? delegate_->IsFullscreenForTabOrPending(this) : false; | 1499 return delegate_ ? delegate_->IsFullscreenForTabOrPending(this) : false; |
1489 } | 1500 } |
1490 | 1501 |
1491 void WebContentsImpl::RequestToLockMouse(bool user_gesture, | 1502 void WebContentsImpl::RequestToLockMouse(bool user_gesture, |
(...skipping 3019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4511 node->render_manager()->ResumeResponseDeferredAtStart(); | 4522 node->render_manager()->ResumeResponseDeferredAtStart(); |
4512 } | 4523 } |
4513 | 4524 |
4514 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4525 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
4515 force_disable_overscroll_content_ = force_disable; | 4526 force_disable_overscroll_content_ = force_disable; |
4516 if (view_) | 4527 if (view_) |
4517 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4528 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
4518 } | 4529 } |
4519 | 4530 |
4520 } // namespace content | 4531 } // namespace content |
OLD | NEW |