Chromium Code Reviews| 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 1572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1583 void WebContentsImpl::ReplicatePageFocus(bool is_focused) { | 1583 void WebContentsImpl::ReplicatePageFocus(bool is_focused) { |
| 1584 // Focus loss may occur while this WebContents is being destroyed. Don't | 1584 // Focus loss may occur while this WebContents is being destroyed. Don't |
| 1585 // send the message in this case, as the main frame's RenderFrameHost and | 1585 // send the message in this case, as the main frame's RenderFrameHost and |
| 1586 // other state has already been cleared. | 1586 // other state has already been cleared. |
| 1587 if (is_being_destroyed_) | 1587 if (is_being_destroyed_) |
| 1588 return; | 1588 return; |
| 1589 | 1589 |
| 1590 frame_tree_.ReplicatePageFocus(is_focused); | 1590 frame_tree_.ReplicatePageFocus(is_focused); |
| 1591 } | 1591 } |
| 1592 | 1592 |
| 1593 RenderWidgetHostImpl* WebContentsImpl::GetFocusedRenderWidgetHost() { | |
|
alexmos
2015/10/23 23:40:16
I wasn't sure whether this logic should go into Re
kenrb
2015/10/28 21:07:05
I was thinking about this also, but I can't think
| |
| 1594 RenderWidgetHostImpl* target_rwh; | |
| 1595 FrameTreeNode* focused_frame = frame_tree_.GetFocusedFrame(); | |
| 1596 if (!focused_frame) { | |
| 1597 target_rwh = GetMainFrame()->GetRenderWidgetHost(); | |
| 1598 } else { | |
| 1599 target_rwh = RenderWidgetHostImpl::From( | |
| 1600 focused_frame->current_frame_host()->GetView()->GetRenderWidgetHost()); | |
| 1601 } | |
| 1602 return target_rwh; | |
|
alexmos
2015/10/23 23:40:16
I thought about whether this should check AreCross
kenrb
2015/10/28 21:07:05
Will this affect browser plugin? Currently that st
alexmos
2015/10/29 05:26:29
I've tried it on a sample app with <webview>, and
| |
| 1603 } | |
| 1604 | |
| 1593 void WebContentsImpl::EnterFullscreenMode(const GURL& origin) { | 1605 void WebContentsImpl::EnterFullscreenMode(const GURL& origin) { |
| 1594 // This method is being called to enter renderer-initiated fullscreen mode. | 1606 // This method is being called to enter renderer-initiated fullscreen mode. |
| 1595 // Make sure any existing fullscreen widget is shut down first. | 1607 // Make sure any existing fullscreen widget is shut down first. |
| 1596 RenderWidgetHostView* const widget_view = GetFullscreenRenderWidgetHostView(); | 1608 RenderWidgetHostView* const widget_view = GetFullscreenRenderWidgetHostView(); |
| 1597 if (widget_view) | 1609 if (widget_view) |
| 1598 RenderWidgetHostImpl::From(widget_view->GetRenderWidgetHost())->Shutdown(); | 1610 RenderWidgetHostImpl::From(widget_view->GetRenderWidgetHost())->Shutdown(); |
| 1599 | 1611 |
| 1600 if (delegate_) | 1612 if (delegate_) |
| 1601 delegate_->EnterFullscreenModeForTab(this, origin); | 1613 delegate_->EnterFullscreenModeForTab(this, origin); |
| 1602 | 1614 |
| (...skipping 3047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4650 return NULL; | 4662 return NULL; |
| 4651 } | 4663 } |
| 4652 | 4664 |
| 4653 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4665 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
| 4654 force_disable_overscroll_content_ = force_disable; | 4666 force_disable_overscroll_content_ = force_disable; |
| 4655 if (view_) | 4667 if (view_) |
| 4656 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4668 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
| 4657 } | 4669 } |
| 4658 | 4670 |
| 4659 } // namespace content | 4671 } // namespace content |
| OLD | NEW |