| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ppapi/cpp/input_event.h" | 7 #include "ppapi/cpp/input_event.h" |
| 8 #include "ppapi/cpp/point.h" | 8 #include "ppapi/cpp/point.h" |
| 9 #include "remoting/client/plugin/pepper_view_proxy.h" | 9 #include "remoting/client/plugin/pepper_view_proxy.h" |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 SendKeyEvent(keydown, event.GetKeyCode()); | 33 SendKeyEvent(keydown, event.GetKeyCode()); |
| 34 } | 34 } |
| 35 | 35 |
| 36 void PepperInputHandler::HandleCharacterEvent( | 36 void PepperInputHandler::HandleCharacterEvent( |
| 37 const pp::KeyboardInputEvent& event) { | 37 const pp::KeyboardInputEvent& event) { |
| 38 // TODO(garykac): Coordinate key and char events. | 38 // TODO(garykac): Coordinate key and char events. |
| 39 } | 39 } |
| 40 | 40 |
| 41 void PepperInputHandler::HandleMouseMoveEvent( | 41 void PepperInputHandler::HandleMouseMoveEvent( |
| 42 const pp::MouseInputEvent& event) { | 42 const pp::MouseInputEvent& event) { |
| 43 gfx::Point p(event.GetPosition().x(), event.GetPosition().y()); | 43 SkIPoint p(SkIPoint::Make(event.GetPosition().x(), event.GetPosition().y())); |
| 44 // Pepper gives co-ordinates in the plugin instance's co-ordinate system, | 44 // Pepper gives co-ordinates in the plugin instance's co-ordinate system, |
| 45 // which may be different from the host desktop's co-ordinate system. | 45 // which may be different from the host desktop's co-ordinate system. |
| 46 double horizontal_ratio = view_->GetHorizontalScaleRatio(); | 46 double horizontal_ratio = view_->GetHorizontalScaleRatio(); |
| 47 double vertical_ratio = view_->GetVerticalScaleRatio(); | 47 double vertical_ratio = view_->GetVerticalScaleRatio(); |
| 48 | 48 |
| 49 if (horizontal_ratio == 0.0) | 49 if (horizontal_ratio == 0.0) |
| 50 horizontal_ratio = 1.0; | 50 horizontal_ratio = 1.0; |
| 51 if (vertical_ratio == 0.0) | 51 if (vertical_ratio == 0.0) |
| 52 vertical_ratio = 1.0; | 52 vertical_ratio = 1.0; |
| 53 | 53 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 72 // Leave button undefined. | 72 // Leave button undefined. |
| 73 break; | 73 break; |
| 74 } | 74 } |
| 75 | 75 |
| 76 if (button != MouseEvent::BUTTON_UNDEFINED) { | 76 if (button != MouseEvent::BUTTON_UNDEFINED) { |
| 77 SendMouseButtonEvent(button_down, button); | 77 SendMouseButtonEvent(button_down, button); |
| 78 } | 78 } |
| 79 } | 79 } |
| 80 | 80 |
| 81 } // namespace remoting | 81 } // namespace remoting |
| OLD | NEW |