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

Unified Diff: remoting/client/plugin/pepper_input_handler.cc

Issue 296943003: Allow mouse-input to be enabled even if the plugin does not have keyboard focus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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: remoting/client/plugin/pepper_input_handler.cc
diff --git a/remoting/client/plugin/pepper_input_handler.cc b/remoting/client/plugin/pepper_input_handler.cc
index 60a2746b8cd0fd2d1db7bb4b2d8623eba1e88f41..b3e51c95df9ed2d61fe121c88be1422d470517f3 100644
--- a/remoting/client/plugin/pepper_input_handler.cc
+++ b/remoting/client/plugin/pepper_input_handler.cc
@@ -24,6 +24,7 @@ PepperInputHandler::PepperInputHandler(
input_stub_(input_stub),
callback_factory_(this),
has_focus_(false),
+ send_mouse_input_when_unfocused_(false),
Wez 2014/05/22 01:14:23 nit: You could call this (and the related method,
Jamie 2014/05/22 01:32:09 Since it controls more than just mouse movements,
mouse_lock_state_(MouseLockDisallowed),
wheel_delta_x_(0),
wheel_delta_y_(0),
@@ -75,7 +76,7 @@ bool PepperInputHandler::HandleInputEvent(const pp::InputEvent& event) {
case PP_INPUTEVENT_TYPE_MOUSEDOWN:
case PP_INPUTEVENT_TYPE_MOUSEUP: {
- if (!has_focus_)
+ if (!has_focus_ && !send_mouse_input_when_unfocused_)
Wez 2014/05/22 01:14:23 Should we be filtering these at all? Is there any
Jamie 2014/05/22 01:32:09 I wrote up a summary when I added this code: http
return false;
pp::MouseInputEvent pp_mouse_event(event);
@@ -114,7 +115,7 @@ bool PepperInputHandler::HandleInputEvent(const pp::InputEvent& event) {
case PP_INPUTEVENT_TYPE_MOUSEMOVE:
case PP_INPUTEVENT_TYPE_MOUSEENTER:
case PP_INPUTEVENT_TYPE_MOUSELEAVE: {
- if (!has_focus_)
+ if (!has_focus_ && !send_mouse_input_when_unfocused_)
return false;
pp::MouseInputEvent pp_mouse_event(event);
@@ -134,7 +135,7 @@ bool PepperInputHandler::HandleInputEvent(const pp::InputEvent& event) {
}
case PP_INPUTEVENT_TYPE_WHEEL: {
- if (!has_focus_)
+ if (!has_focus_ && !send_mouse_input_when_unfocused_)
return false;
pp::WheelInputEvent pp_wheel_event(event);
@@ -216,6 +217,10 @@ void PepperInputHandler::SetMouseCursor(scoped_ptr<pp::ImageData> image,
}
}
+void PepperInputHandler::SendMouseInputWhenUnfocused() {
+ send_mouse_input_when_unfocused_ = true;
+}
+
void PepperInputHandler::MouseLockLost() {
DCHECK(mouse_lock_state_ == MouseLockOn ||
mouse_lock_state_ == MouseLockCancelling);

Powered by Google App Engine
This is Rietveld 408576698