| 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 1629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1640 | 1640 |
| 1641 // Events for widgets other than the main frame (e.g., popup menus) should be | 1641 // Events for widgets other than the main frame (e.g., popup menus) should be |
| 1642 // forwarded directly to the widget they arrived on. | 1642 // forwarded directly to the widget they arrived on. |
| 1643 if (receiving_widget != GetMainFrame()->GetRenderWidgetHost()) | 1643 if (receiving_widget != GetMainFrame()->GetRenderWidgetHost()) |
| 1644 return receiving_widget; | 1644 return receiving_widget; |
| 1645 | 1645 |
| 1646 FrameTreeNode* focused_frame = frame_tree_.GetFocusedFrame(); | 1646 FrameTreeNode* focused_frame = frame_tree_.GetFocusedFrame(); |
| 1647 if (!focused_frame) | 1647 if (!focused_frame) |
| 1648 return receiving_widget; | 1648 return receiving_widget; |
| 1649 | 1649 |
| 1650 return RenderWidgetHostImpl::From( | 1650 // The view may be null if a subframe's renderer process has crashed while |
| 1651 focused_frame->current_frame_host()->GetView()->GetRenderWidgetHost()); | 1651 // the subframe has focus. Drop the event in that case. Do not give |
| 1652 // it to the main frame, so that the user doesn't unexpectedly type into the |
| 1653 // wrong frame if a focused subframe renderer crashes while they type. |
| 1654 RenderWidgetHostView* view = focused_frame->current_frame_host()->GetView(); |
| 1655 if (!view) |
| 1656 return nullptr; |
| 1657 |
| 1658 return RenderWidgetHostImpl::From(view->GetRenderWidgetHost()); |
| 1652 } | 1659 } |
| 1653 | 1660 |
| 1654 void WebContentsImpl::EnterFullscreenMode(const GURL& origin) { | 1661 void WebContentsImpl::EnterFullscreenMode(const GURL& origin) { |
| 1655 // This method is being called to enter renderer-initiated fullscreen mode. | 1662 // This method is being called to enter renderer-initiated fullscreen mode. |
| 1656 // Make sure any existing fullscreen widget is shut down first. | 1663 // Make sure any existing fullscreen widget is shut down first. |
| 1657 RenderWidgetHostView* const widget_view = GetFullscreenRenderWidgetHostView(); | 1664 RenderWidgetHostView* const widget_view = GetFullscreenRenderWidgetHostView(); |
| 1658 if (widget_view) | 1665 if (widget_view) |
| 1659 RenderWidgetHostImpl::From(widget_view->GetRenderWidgetHost())->Shutdown(); | 1666 RenderWidgetHostImpl::From(widget_view->GetRenderWidgetHost())->Shutdown(); |
| 1660 | 1667 |
| 1661 if (delegate_) | 1668 if (delegate_) |
| (...skipping 3144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4806 return NULL; | 4813 return NULL; |
| 4807 } | 4814 } |
| 4808 | 4815 |
| 4809 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4816 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
| 4810 force_disable_overscroll_content_ = force_disable; | 4817 force_disable_overscroll_content_ = force_disable; |
| 4811 if (view_) | 4818 if (view_) |
| 4812 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4819 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
| 4813 } | 4820 } |
| 4814 | 4821 |
| 4815 } // namespace content | 4822 } // namespace content |
| OLD | NEW |