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 1577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1588 #endif | 1588 #endif |
1589 return false; | 1589 return false; |
1590 } | 1590 } |
1591 | 1591 |
1592 bool WebContentsImpl::PreHandleGestureEvent( | 1592 bool WebContentsImpl::PreHandleGestureEvent( |
1593 const blink::WebGestureEvent& event) { | 1593 const blink::WebGestureEvent& event) { |
1594 return delegate_ && delegate_->PreHandleGestureEvent(this, event); | 1594 return delegate_ && delegate_->PreHandleGestureEvent(this, event); |
1595 } | 1595 } |
1596 | 1596 |
1597 RenderWidgetHostInputEventRouter* WebContentsImpl::GetInputEventRouter() { | 1597 RenderWidgetHostInputEventRouter* WebContentsImpl::GetInputEventRouter() { |
1598 // Currently only supported in site per process mode (--site-per-process). | 1598 if (!is_being_destroyed_ && GetOuterWebContents()) |
1599 if (!rwh_input_event_router_.get() && !is_being_destroyed_ && | 1599 return GetOuterWebContents()->GetInputEventRouter(); |
1600 SiteIsolationPolicy::AreCrossProcessFramesPossible()) | 1600 |
| 1601 if (!rwh_input_event_router_.get() && !is_being_destroyed_) |
1601 rwh_input_event_router_.reset(new RenderWidgetHostInputEventRouter); | 1602 rwh_input_event_router_.reset(new RenderWidgetHostInputEventRouter); |
1602 return rwh_input_event_router_.get(); | 1603 return rwh_input_event_router_.get(); |
1603 } | 1604 } |
1604 | 1605 |
1605 void WebContentsImpl::ReplicatePageFocus(bool is_focused) { | 1606 void WebContentsImpl::ReplicatePageFocus(bool is_focused) { |
1606 // Focus loss may occur while this WebContents is being destroyed. Don't | 1607 // Focus loss may occur while this WebContents is being destroyed. Don't |
1607 // send the message in this case, as the main frame's RenderFrameHost and | 1608 // send the message in this case, as the main frame's RenderFrameHost and |
1608 // other state has already been cleared. | 1609 // other state has already been cleared. |
1609 if (is_being_destroyed_) | 1610 if (is_being_destroyed_) |
1610 return; | 1611 return; |
(...skipping 3096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4707 const WebContentsObserver::MediaPlayerId& id) { | 4708 const WebContentsObserver::MediaPlayerId& id) { |
4708 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id)); | 4709 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id)); |
4709 } | 4710 } |
4710 | 4711 |
4711 void WebContentsImpl::MediaStoppedPlaying( | 4712 void WebContentsImpl::MediaStoppedPlaying( |
4712 const WebContentsObserver::MediaPlayerId& id) { | 4713 const WebContentsObserver::MediaPlayerId& id) { |
4713 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); | 4714 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); |
4714 } | 4715 } |
4715 | 4716 |
4716 } // namespace content | 4717 } // namespace content |
OLD | NEW |