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

Side by Side Diff: remoting/client/plugin/pepper_input_handler.cc

Issue 3175028: Add mouse event support to Chromoting client (Pepper and X11). (Closed)
Patch Set: Remove win float/int conversion Created 10 years, 3 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 unified diff | Download patch
« no previous file with comments | « remoting/client/plugin/pepper_input_handler.h ('k') | remoting/client/x11_input_handler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 namespace remoting { 7 namespace remoting {
8 8
9 PepperInputHandler::PepperInputHandler(ClientContext* context, 9 PepperInputHandler::PepperInputHandler(ClientContext* context,
10 HostConnection* connection, 10 HostConnection* connection,
11 ChromotingView* view) 11 ChromotingView* view)
12 : InputHandler(context, connection, view) { 12 : InputHandler(context, connection, view) {
13 } 13 }
14 14
15 PepperInputHandler::~PepperInputHandler() { 15 PepperInputHandler::~PepperInputHandler() {
16 } 16 }
17 17
18 void PepperInputHandler::Initialize() { 18 void PepperInputHandler::Initialize() {
19 // TODO(garykac): Implement this. 19 }
20
21 void PepperInputHandler::HandleMouseMoveEvent(const PP_Event_Mouse& event) {
22 SendMouseMoveEvent(static_cast<int>(event.x),
23 static_cast<int>(event.y));
24 }
25
26 void PepperInputHandler::HandleMouseButtonEvent(bool button_down,
27 const PP_Event_Mouse& event) {
28 MouseButton button = MouseButtonUndefined;
29 if (event.button == PP_EVENT_MOUSEBUTTON_LEFT) {
30 button = MouseButtonLeft;
31 } else if (event.button == PP_EVENT_MOUSEBUTTON_MIDDLE) {
32 button = MouseButtonMiddle;
33 } else if (event.button == PP_EVENT_MOUSEBUTTON_RIGHT) {
34 button = MouseButtonRight;
35 }
36
37 if (button != MouseButtonUndefined) {
38 SendMouseButtonEvent(button_down, button);
39 }
20 } 40 }
21 41
22 } // namespace remoting 42 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/client/plugin/pepper_input_handler.h ('k') | remoting/client/x11_input_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698