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 1567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1578 } | 1578 } |
1579 | 1579 |
1580 RenderWidgetHostInputEventRouter* WebContentsImpl::GetInputEventRouter() { | 1580 RenderWidgetHostInputEventRouter* WebContentsImpl::GetInputEventRouter() { |
1581 // Currently only supported in site per process mode (--site-per-process). | 1581 // Currently only supported in site per process mode (--site-per-process). |
1582 if (!rwh_input_event_router_.get() && !is_being_destroyed_ && | 1582 if (!rwh_input_event_router_.get() && !is_being_destroyed_ && |
1583 SiteIsolationPolicy::AreCrossProcessFramesPossible()) | 1583 SiteIsolationPolicy::AreCrossProcessFramesPossible()) |
1584 rwh_input_event_router_.reset(new RenderWidgetHostInputEventRouter); | 1584 rwh_input_event_router_.reset(new RenderWidgetHostInputEventRouter); |
1585 return rwh_input_event_router_.get(); | 1585 return rwh_input_event_router_.get(); |
1586 } | 1586 } |
1587 | 1587 |
| 1588 void WebContentsImpl::ReplicatePageFocus(bool is_focused) { |
| 1589 // Focus loss may occur while this WebContents is being destroyed. Don't |
| 1590 // send the message in this case, as the main frame's RenderFrameHost and |
| 1591 // other state has already been cleared. |
| 1592 if (is_being_destroyed_) |
| 1593 return; |
| 1594 |
| 1595 frame_tree_.ReplicatePageFocus(is_focused); |
| 1596 } |
| 1597 |
1588 void WebContentsImpl::EnterFullscreenMode(const GURL& origin) { | 1598 void WebContentsImpl::EnterFullscreenMode(const GURL& origin) { |
1589 // This method is being called to enter renderer-initiated fullscreen mode. | 1599 // This method is being called to enter renderer-initiated fullscreen mode. |
1590 // Make sure any existing fullscreen widget is shut down first. | 1600 // Make sure any existing fullscreen widget is shut down first. |
1591 RenderWidgetHostView* const widget_view = GetFullscreenRenderWidgetHostView(); | 1601 RenderWidgetHostView* const widget_view = GetFullscreenRenderWidgetHostView(); |
1592 if (widget_view) | 1602 if (widget_view) |
1593 RenderWidgetHostImpl::From(widget_view->GetRenderWidgetHost())->Shutdown(); | 1603 RenderWidgetHostImpl::From(widget_view->GetRenderWidgetHost())->Shutdown(); |
1594 | 1604 |
1595 if (delegate_) | 1605 if (delegate_) |
1596 delegate_->EnterFullscreenModeForTab(this, origin); | 1606 delegate_->EnterFullscreenModeForTab(this, origin); |
1597 | 1607 |
(...skipping 3047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4645 return NULL; | 4655 return NULL; |
4646 } | 4656 } |
4647 | 4657 |
4648 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4658 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
4649 force_disable_overscroll_content_ = force_disable; | 4659 force_disable_overscroll_content_ = force_disable; |
4650 if (view_) | 4660 if (view_) |
4651 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4661 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
4652 } | 4662 } |
4653 | 4663 |
4654 } // namespace content | 4664 } // namespace content |
OLD | NEW |