diff options
author | weitaosu@chromium.org <weitaosu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-04 07:51:34 +0000 |
---|---|---|
committer | weitaosu@chromium.org <weitaosu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-04 07:51:34 +0000 |
commit | e7191cc4d7bcaa6ab81ac18c6eb6ed0ca0992ba1 (patch) | |
tree | 65a86d17b38564b5c8de664ac1a428d7d7b7d81f /remoting/client | |
parent | b0c63d783c1938bbbbecd630855feed783d218af (diff) | |
download | chromium_src-e7191cc4d7bcaa6ab81ac18c6eb6ed0ca0992ba1.zip chromium_src-e7191cc4d7bcaa6ab81ac18c6eb6ed0ca0992ba1.tar.gz chromium_src-e7191cc4d7bcaa6ab81ac18c6eb6ed0ca0992ba1.tar.bz2 |
Issue 245137: Mouse-move events not sent after clicking on drop-down toolbar
Revert "Issue 236549: Inactive window should not be capturing mouseover"
This reverts commit bb5596a07d45d3a4832b337c62a22e2c3f90a7ee.
See issue 246335: pepper plugin no longer gets notified on of didChangeFocus.
BUG=245137
Review URL: https://chromiumcodereview.appspot.com/16140022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203904 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/client')
-rw-r--r-- | remoting/client/plugin/chromoting_instance.cc | 6 | ||||
-rw-r--r-- | remoting/client/plugin/chromoting_instance.h | 1 | ||||
-rw-r--r-- | remoting/client/plugin/pepper_input_handler.cc | 67 | ||||
-rw-r--r-- | remoting/client/plugin/pepper_input_handler.h | 9 |
4 files changed, 27 insertions, 56 deletions
diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc index 8b775c1..dcfb7ce 100644 --- a/remoting/client/plugin/chromoting_instance.cc +++ b/remoting/client/plugin/chromoting_instance.cc @@ -446,12 +446,6 @@ void ChromotingInstance::DidChangeView(const pp::View& view) { } } -void ChromotingInstance::DidChangeFocus(bool has_focus) { - DCHECK(plugin_task_runner_->BelongsToCurrentThread()); - - input_handler_.OnFocusChanged(has_focus); -} - bool ChromotingInstance::HandleInputEvent(const pp::InputEvent& event) { DCHECK(plugin_task_runner_->BelongsToCurrentThread()); diff --git a/remoting/client/plugin/chromoting_instance.h b/remoting/client/plugin/chromoting_instance.h index c71576b..9cc85ec 100644 --- a/remoting/client/plugin/chromoting_instance.h +++ b/remoting/client/plugin/chromoting_instance.h @@ -108,7 +108,6 @@ class ChromotingInstance : // pp::Instance interface. virtual void DidChangeView(const pp::View& view) OVERRIDE; - virtual void DidChangeFocus(bool has_focus) OVERRIDE; virtual bool Init(uint32_t argc, const char* argn[], const char* argv[]) OVERRIDE; virtual void HandleMessage(const pp::Var& message) OVERRIDE; diff --git a/remoting/client/plugin/pepper_input_handler.cc b/remoting/client/plugin/pepper_input_handler.cc index 847fe16d..0bb1262 100644 --- a/remoting/client/plugin/pepper_input_handler.cc +++ b/remoting/client/plugin/pepper_input_handler.cc @@ -15,7 +15,6 @@ namespace remoting { PepperInputHandler::PepperInputHandler(protocol::InputStub* input_stub) : input_stub_(input_stub), - has_focus_(false), wheel_delta_x_(0), wheel_delta_y_(0) { } @@ -34,10 +33,6 @@ uint32_t GetUsbKeyCode(pp::KeyboardInputEvent pp_key_event) { return key_event_interface->GetUsbKeyCode(pp_key_event.pp_resource()); } -void PepperInputHandler::OnFocusChanged(bool has_focus) { - has_focus_ = has_focus; -} - bool PepperInputHandler::HandleInputEvent(const pp::InputEvent& event) { switch (event.GetType()) { case PP_INPUTEVENT_TYPE_CONTEXTMENU: { @@ -86,45 +81,37 @@ bool PepperInputHandler::HandleInputEvent(const pp::InputEvent& event) { case PP_INPUTEVENT_TYPE_MOUSEMOVE: case PP_INPUTEVENT_TYPE_MOUSEENTER: case PP_INPUTEVENT_TYPE_MOUSELEAVE: { - // Don't pass these mouse events through when the - // client doesn't have focus. - if (has_focus_) { - pp::MouseInputEvent pp_mouse_event(event); - protocol::MouseEvent mouse_event; - mouse_event.set_x(pp_mouse_event.GetPosition().x()); - mouse_event.set_y(pp_mouse_event.GetPosition().y()); - input_stub_->InjectMouseEvent(mouse_event); - } + pp::MouseInputEvent pp_mouse_event(event); + protocol::MouseEvent mouse_event; + mouse_event.set_x(pp_mouse_event.GetPosition().x()); + mouse_event.set_y(pp_mouse_event.GetPosition().y()); + input_stub_->InjectMouseEvent(mouse_event); return true; } case PP_INPUTEVENT_TYPE_WHEEL: { - // Don't pass wheel events through when the - // client doesn't have focus. - if (has_focus_) { - pp::WheelInputEvent pp_wheel_event(event); - - // Don't handle scroll-by-page events, for now. - if (pp_wheel_event.GetScrollByPage()) - return false; - - // Add this event to our accumulated sub-pixel deltas. - pp::FloatPoint delta = pp_wheel_event.GetDelta(); - wheel_delta_x_ += delta.x(); - wheel_delta_y_ += delta.y(); - - // If there is at least a pixel's movement, emit an event. - int delta_x = static_cast<int>(wheel_delta_x_); - int delta_y = static_cast<int>(wheel_delta_y_); - if (delta_x != 0 || delta_y != 0) { - wheel_delta_x_ -= delta_x; - wheel_delta_y_ -= delta_y; - protocol::MouseEvent mouse_event; - mouse_event.set_wheel_delta_x(delta_x); - mouse_event.set_wheel_delta_y(delta_y); - - input_stub_->InjectMouseEvent(mouse_event); - } + pp::WheelInputEvent pp_wheel_event(event); + + // Don't handle scroll-by-page events, for now. + if (pp_wheel_event.GetScrollByPage()) + return false; + + // Add this event to our accumulated sub-pixel deltas. + pp::FloatPoint delta = pp_wheel_event.GetDelta(); + wheel_delta_x_ += delta.x(); + wheel_delta_y_ += delta.y(); + + // If there is at least a pixel's movement, emit an event. + int delta_x = static_cast<int>(wheel_delta_x_); + int delta_y = static_cast<int>(wheel_delta_y_); + if (delta_x != 0 || delta_y != 0) { + wheel_delta_x_ -= delta_x; + wheel_delta_y_ -= delta_y; + protocol::MouseEvent mouse_event; + mouse_event.set_wheel_delta_x(delta_x); + mouse_event.set_wheel_delta_y(delta_y); + + input_stub_->InjectMouseEvent(mouse_event); } return true; } diff --git a/remoting/client/plugin/pepper_input_handler.h b/remoting/client/plugin/pepper_input_handler.h index 822c3ca..2983b07a 100644 --- a/remoting/client/plugin/pepper_input_handler.h +++ b/remoting/client/plugin/pepper_input_handler.h @@ -23,20 +23,11 @@ class PepperInputHandler { explicit PepperInputHandler(protocol::InputStub* input_stub); virtual ~PepperInputHandler(); - // Called by ChromotingInstance::DidChangeFocus when the instance - // goes in or out of focus. Sets or clears the has_focus_ flag - // which controls whether the client passes mouse and wheel - // events to the remoting server. - void OnFocusChanged(bool has_focus); - bool HandleInputEvent(const pp::InputEvent& event); private: protocol::InputStub* input_stub_; - // Flag indicating whether the calling plugin has focus. - bool has_focus_; - // Accumulated sub-pixel deltas from wheel events. float wheel_delta_x_; float wheel_delta_y_; |