Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(362)

Unified Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 10458008: Support mouse lock in Flash fullscreen mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_widget_host_impl.cc
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 04ee30d22f39b3c6a25d7e9cc49d2118922272ad..cf740091b49514861ac603a105c782af03f96738 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -130,6 +130,7 @@ RenderWidgetHostImpl::RenderWidgetHostImpl(RenderWidgetHostDelegate* delegate,
text_direction_canceled_(false),
suppress_next_char_events_(false),
pending_mouse_lock_request_(false),
+ allow_privileged_mouse_lock_(false),
has_touch_handler_(false),
ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)),
tap_suppression_controller_(new TapSuppressionController(this)) {
@@ -233,6 +234,8 @@ void RenderWidgetHostImpl::Init() {
}
void RenderWidgetHostImpl::Shutdown() {
+ RejectMouseLockOrUnlockIfNecessary();
+
if (process_->HasConnection()) {
// Tell the renderer object to close.
bool rv = Send(new ViewMsg_Close(routing_id_));
@@ -1488,7 +1491,8 @@ void RenderWidgetHostImpl::OnMsgDidActivateAcceleratedCompositing(
}
void RenderWidgetHostImpl::OnMsgLockMouse(bool user_gesture,
- bool last_unlocked_by_target) {
+ bool last_unlocked_by_target,
+ bool privileged) {
if (pending_mouse_lock_request_) {
Send(new ViewMsg_LockMouse_ACK(routing_id_, false));
@@ -1499,7 +1503,12 @@ void RenderWidgetHostImpl::OnMsgLockMouse(bool user_gesture,
}
pending_mouse_lock_request_ = true;
- RequestToLockMouse(user_gesture, last_unlocked_by_target);
+ if (privileged && allow_privileged_mouse_lock_) {
+ // Directly approve to lock the mouse.
+ GotResponseToLockMouseRequest(true);
+ } else {
+ RequestToLockMouse(user_gesture, last_unlocked_by_target);
+ }
}
void RenderWidgetHostImpl::OnMsgUnlockMouse() {
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.h ('k') | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698