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

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

Issue 136093013: Don't send mouse events if the plugin doesn't have focus. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Retry upload Created 6 years, 10 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
« no previous file with comments | « no previous file | remoting/webapp/client_session.js » ('j') | remoting/webapp/client_session.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9069f1a1f0b3703c2db1678ec8640d0f28c7b444..60a2746b8cd0fd2d1db7bb4b2d8623eba1e88f41 100644
--- a/remoting/client/plugin/pepper_input_handler.cc
+++ b/remoting/client/plugin/pepper_input_handler.cc
@@ -75,6 +75,9 @@ bool PepperInputHandler::HandleInputEvent(const pp::InputEvent& event) {
case PP_INPUTEVENT_TYPE_MOUSEDOWN:
case PP_INPUTEVENT_TYPE_MOUSEUP: {
+ if (!has_focus_)
+ return false;
Jamie 2014/02/07 22:34:39 I'm in two minds about this one. Some platforms (s
weitao 2014/02/07 23:54:23 I agree the first behavior is better. On 2014/02/
+
pp::MouseInputEvent pp_mouse_event(event);
protocol::MouseEvent mouse_event;
switch (pp_mouse_event.GetButton()) {
@@ -111,6 +114,9 @@ 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_)
+ return false;
+
pp::MouseInputEvent pp_mouse_event(event);
protocol::MouseEvent mouse_event;
mouse_event.set_x(pp_mouse_event.GetPosition().x());
@@ -128,6 +134,9 @@ bool PepperInputHandler::HandleInputEvent(const pp::InputEvent& event) {
}
case PP_INPUTEVENT_TYPE_WHEEL: {
+ if (!has_focus_)
+ return false;
+
pp::WheelInputEvent pp_wheel_event(event);
// Don't handle scroll-by-page events, for now.
« no previous file with comments | « no previous file | remoting/webapp/client_session.js » ('j') | remoting/webapp/client_session.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698