Index: content/browser/web_contents/web_contents_impl.cc |
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc |
index 7d0e6c7deb7c979c39ec12c6dcb253603b3f75e3..542760ca87e937708c7da5b77c579995d6a70626 100644 |
--- a/content/browser/web_contents/web_contents_impl.cc |
+++ b/content/browser/web_contents/web_contents_impl.cc |
@@ -1643,20 +1643,15 @@ void WebContentsImpl::ShowCreatedWidget(int route_id, |
RenderWidgetHostViewPort::FromRWHV(GetCreatedWidget(route_id)); |
if (!widget_host_view) |
return; |
- bool allow_privileged = false; |
if (is_fullscreen) { |
+ DCHECK_EQ(MSG_ROUTING_NONE, fullscreen_widget_routing_id_); |
+ fullscreen_widget_routing_id_ = route_id; |
if (delegate_ && delegate_->EmbedsFullscreenWidget()) { |
widget_host_view->InitAsChild(GetRenderWidgetHostView()->GetNativeView()); |
delegate_->ToggleFullscreenModeForTab(this, true); |
} else { |
widget_host_view->InitAsFullscreen(GetRenderWidgetHostViewPort()); |
- // Only allow privileged mouse lock for fullscreen render widget, which is |
- // used to implement Pepper Flash fullscreen. |
- allow_privileged = true; |
} |
- |
- DCHECK_EQ(MSG_ROUTING_NONE, fullscreen_widget_routing_id_); |
- fullscreen_widget_routing_id_ = route_id; |
FOR_EACH_OBSERVER(WebContentsObserver, |
observers_, |
DidShowFullscreenWidget(route_id)); |
@@ -1669,9 +1664,9 @@ void WebContentsImpl::ShowCreatedWidget(int route_id, |
RenderWidgetHostImpl* render_widget_host_impl = |
RenderWidgetHostImpl::From(widget_host_view->GetRenderWidgetHost()); |
render_widget_host_impl->Init(); |
- render_widget_host_impl->set_allow_privileged_mouse_lock(allow_privileged); |
- // TODO(miu): For now, all mouse lock requests by embedded Flash fullscreen |
- // will be denied. This is to be rectified in a soon-upcoming change. |
+ // Only allow privileged mouse lock for fullscreen render widget, which is |
+ // used to implement Pepper Flash fullscreen. |
+ render_widget_host_impl->set_allow_privileged_mouse_lock(is_fullscreen); |
#if defined(OS_MACOSX) |
// A RenderWidgetHostViewMac has lifetime scoped to the view. Now that it's |