| 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 1623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1634 if (!view) | 1634 if (!view) |
| 1635 return nullptr; | 1635 return nullptr; |
| 1636 | 1636 |
| 1637 return RenderWidgetHostImpl::From(view->GetRenderWidgetHost()); | 1637 return RenderWidgetHostImpl::From(view->GetRenderWidgetHost()); |
| 1638 } | 1638 } |
| 1639 | 1639 |
| 1640 void WebContentsImpl::EnterFullscreenMode(const GURL& origin) { | 1640 void WebContentsImpl::EnterFullscreenMode(const GURL& origin) { |
| 1641 // This method is being called to enter renderer-initiated fullscreen mode. | 1641 // This method is being called to enter renderer-initiated fullscreen mode. |
| 1642 // Make sure any existing fullscreen widget is shut down first. | 1642 // Make sure any existing fullscreen widget is shut down first. |
| 1643 RenderWidgetHostView* const widget_view = GetFullscreenRenderWidgetHostView(); | 1643 RenderWidgetHostView* const widget_view = GetFullscreenRenderWidgetHostView(); |
| 1644 if (widget_view) | 1644 if (widget_view) { |
| 1645 RenderWidgetHostImpl::From(widget_view->GetRenderWidgetHost())->Shutdown(); | 1645 RenderWidgetHostImpl::From(widget_view->GetRenderWidgetHost()) |
| 1646 ->ShutdownAndDestroyWidget(true); |
| 1647 } |
| 1646 | 1648 |
| 1647 if (delegate_) | 1649 if (delegate_) |
| 1648 delegate_->EnterFullscreenModeForTab(this, origin); | 1650 delegate_->EnterFullscreenModeForTab(this, origin); |
| 1649 | 1651 |
| 1650 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 1652 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
| 1651 DidToggleFullscreenModeForTab(IsFullscreenForCurrentTab( | 1653 DidToggleFullscreenModeForTab(IsFullscreenForCurrentTab( |
| 1652 GetRenderViewHost()->GetWidget()))); | 1654 GetRenderViewHost()->GetWidget()))); |
| 1653 } | 1655 } |
| 1654 | 1656 |
| 1655 void WebContentsImpl::ExitFullscreenMode() { | 1657 void WebContentsImpl::ExitFullscreenMode() { |
| 1656 // This method is being called to leave renderer-initiated fullscreen mode. | 1658 // This method is being called to leave renderer-initiated fullscreen mode. |
| 1657 // Make sure any existing fullscreen widget is shut down first. | 1659 // Make sure any existing fullscreen widget is shut down first. |
| 1658 RenderWidgetHostView* const widget_view = GetFullscreenRenderWidgetHostView(); | 1660 RenderWidgetHostView* const widget_view = GetFullscreenRenderWidgetHostView(); |
| 1659 if (widget_view) | 1661 if (widget_view) { |
| 1660 RenderWidgetHostImpl::From(widget_view->GetRenderWidgetHost())->Shutdown(); | 1662 RenderWidgetHostImpl::From(widget_view->GetRenderWidgetHost()) |
| 1663 ->ShutdownAndDestroyWidget(true); |
| 1664 } |
| 1661 | 1665 |
| 1662 #if defined(OS_ANDROID) | 1666 #if defined(OS_ANDROID) |
| 1663 ContentVideoView* video_view = ContentVideoView::GetInstance(); | 1667 ContentVideoView* video_view = ContentVideoView::GetInstance(); |
| 1664 if (video_view != NULL) | 1668 if (video_view != NULL) |
| 1665 video_view->OnExitFullscreen(); | 1669 video_view->OnExitFullscreen(); |
| 1666 #endif | 1670 #endif |
| 1667 | 1671 |
| 1668 if (delegate_) | 1672 if (delegate_) |
| 1669 delegate_->ExitFullscreenModeForTab(this); | 1673 delegate_->ExitFullscreenModeForTab(this); |
| 1670 | 1674 |
| (...skipping 3036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4707 const WebContentsObserver::MediaPlayerId& id) { | 4711 const WebContentsObserver::MediaPlayerId& id) { |
| 4708 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id)); | 4712 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id)); |
| 4709 } | 4713 } |
| 4710 | 4714 |
| 4711 void WebContentsImpl::MediaStoppedPlaying( | 4715 void WebContentsImpl::MediaStoppedPlaying( |
| 4712 const WebContentsObserver::MediaPlayerId& id) { | 4716 const WebContentsObserver::MediaPlayerId& id) { |
| 4713 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); | 4717 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); |
| 4714 } | 4718 } |
| 4715 | 4719 |
| 4716 } // namespace content | 4720 } // namespace content |
| OLD | NEW |