| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "remoting/client/plugin/pepper_input_handler.h" | 5 #include "remoting/client/plugin/pepper_input_handler.h" |
| 6 | 6 |
| 7 #include <iomanip> | 7 #include <iomanip> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "ppapi/cpp/input_event.h" | 10 #include "ppapi/cpp/input_event.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 break; | 63 break; |
| 64 case PP_INPUTEVENT_MOUSEBUTTON_RIGHT: | 64 case PP_INPUTEVENT_MOUSEBUTTON_RIGHT: |
| 65 mouse_event.set_button(protocol::MouseEvent::BUTTON_RIGHT); | 65 mouse_event.set_button(protocol::MouseEvent::BUTTON_RIGHT); |
| 66 break; | 66 break; |
| 67 case PP_INPUTEVENT_MOUSEBUTTON_NONE: | 67 case PP_INPUTEVENT_MOUSEBUTTON_NONE: |
| 68 break; | 68 break; |
| 69 } | 69 } |
| 70 if (mouse_event.has_button()) { | 70 if (mouse_event.has_button()) { |
| 71 bool is_down = (event.GetType() == PP_INPUTEVENT_TYPE_MOUSEDOWN); | 71 bool is_down = (event.GetType() == PP_INPUTEVENT_TYPE_MOUSEDOWN); |
| 72 mouse_event.set_button_down(is_down); | 72 mouse_event.set_button_down(is_down); |
| 73 mouse_event.set_x(pp_mouse_event.GetPosition().x()); |
| 74 mouse_event.set_y(pp_mouse_event.GetPosition().y()); |
| 73 input_stub_->InjectMouseEvent(mouse_event); | 75 input_stub_->InjectMouseEvent(mouse_event); |
| 74 } | 76 } |
| 75 return true; | 77 return true; |
| 76 } | 78 } |
| 77 | 79 |
| 78 case PP_INPUTEVENT_TYPE_MOUSEMOVE: | 80 case PP_INPUTEVENT_TYPE_MOUSEMOVE: |
| 79 case PP_INPUTEVENT_TYPE_MOUSEENTER: | 81 case PP_INPUTEVENT_TYPE_MOUSEENTER: |
| 80 case PP_INPUTEVENT_TYPE_MOUSELEAVE: { | 82 case PP_INPUTEVENT_TYPE_MOUSELEAVE: { |
| 81 pp::MouseInputEvent pp_mouse_event(event); | 83 pp::MouseInputEvent pp_mouse_event(event); |
| 82 protocol::MouseEvent mouse_event; | 84 protocol::MouseEvent mouse_event; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 113 default: { | 115 default: { |
| 114 LOG(INFO) << "Unhandled input event: " << event.GetType(); | 116 LOG(INFO) << "Unhandled input event: " << event.GetType(); |
| 115 break; | 117 break; |
| 116 } | 118 } |
| 117 } | 119 } |
| 118 | 120 |
| 119 return false; | 121 return false; |
| 120 } | 122 } |
| 121 | 123 |
| 122 } // namespace remoting | 124 } // namespace remoting |
| OLD | NEW |