| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 1639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1650 // the subframe has focus. Drop the event in that case. Do not give | 1650 // the subframe has focus. Drop the event in that case. Do not give |
| 1651 // it to the main frame, so that the user doesn't unexpectedly type into the | 1651 // it to the main frame, so that the user doesn't unexpectedly type into the |
| 1652 // wrong frame if a focused subframe renderer crashes while they type. | 1652 // wrong frame if a focused subframe renderer crashes while they type. |
| 1653 RenderWidgetHostView* view = focused_frame->current_frame_host()->GetView(); | 1653 RenderWidgetHostView* view = focused_frame->current_frame_host()->GetView(); |
| 1654 if (!view) | 1654 if (!view) |
| 1655 return nullptr; | 1655 return nullptr; |
| 1656 | 1656 |
| 1657 return RenderWidgetHostImpl::From(view->GetRenderWidgetHost()); | 1657 return RenderWidgetHostImpl::From(view->GetRenderWidgetHost()); |
| 1658 } | 1658 } |
| 1659 | 1659 |
| 1660 RenderWidgetHostViewBase* WebContentsImpl::GetFocusedView() { |
| 1661 FrameTreeNode* focused_frame = frame_tree_.GetFocusedFrame(); |
| 1662 if (!focused_frame) |
| 1663 return nullptr; |
| 1664 |
| 1665 return static_cast<RenderWidgetHostViewBase*>( |
| 1666 focused_frame->current_frame_host()->GetView()); |
| 1667 } |
| 1668 |
| 1660 void WebContentsImpl::EnterFullscreenMode(const GURL& origin) { | 1669 void WebContentsImpl::EnterFullscreenMode(const GURL& origin) { |
| 1661 // This method is being called to enter renderer-initiated fullscreen mode. | 1670 // This method is being called to enter renderer-initiated fullscreen mode. |
| 1662 // Make sure any existing fullscreen widget is shut down first. | 1671 // Make sure any existing fullscreen widget is shut down first. |
| 1663 RenderWidgetHostView* const widget_view = GetFullscreenRenderWidgetHostView(); | 1672 RenderWidgetHostView* const widget_view = GetFullscreenRenderWidgetHostView(); |
| 1664 if (widget_view) { | 1673 if (widget_view) { |
| 1665 RenderWidgetHostImpl::From(widget_view->GetRenderWidgetHost()) | 1674 RenderWidgetHostImpl::From(widget_view->GetRenderWidgetHost()) |
| 1666 ->ShutdownAndDestroyWidget(true); | 1675 ->ShutdownAndDestroyWidget(true); |
| 1667 } | 1676 } |
| 1668 | 1677 |
| 1669 if (delegate_) | 1678 if (delegate_) |
| (...skipping 3091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4761 const WebContentsObserver::MediaPlayerId& id) { | 4770 const WebContentsObserver::MediaPlayerId& id) { |
| 4762 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id)); | 4771 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id)); |
| 4763 } | 4772 } |
| 4764 | 4773 |
| 4765 void WebContentsImpl::MediaStoppedPlaying( | 4774 void WebContentsImpl::MediaStoppedPlaying( |
| 4766 const WebContentsObserver::MediaPlayerId& id) { | 4775 const WebContentsObserver::MediaPlayerId& id) { |
| 4767 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); | 4776 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); |
| 4768 } | 4777 } |
| 4769 | 4778 |
| 4770 } // namespace content | 4779 } // namespace content |
| OLD | NEW |