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

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

Issue 3341005: Add mouse/keyboard event support to Chromoting client (Pepper and X11). (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: review comments 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/input_handler.cc ('k') | remoting/client/plugin/pepper_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/chromoting_instance.h" 5 #include "remoting/client/plugin/chromoting_instance.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 114
115 bool ChromotingInstance::HandleEvent(const PP_Event& event) { 115 bool ChromotingInstance::HandleEvent(const PP_Event& event) {
116 DCHECK(CurrentlyOnPluginThread()); 116 DCHECK(CurrentlyOnPluginThread());
117 117
118 PepperInputHandler* pih 118 PepperInputHandler* pih
119 = static_cast<PepperInputHandler*>(input_handler_.get()); 119 = static_cast<PepperInputHandler*>(input_handler_.get());
120 120
121 switch (event.type) { 121 switch (event.type) {
122 case PP_EVENT_TYPE_MOUSEDOWN: 122 case PP_EVENT_TYPE_MOUSEDOWN:
123 pih->HandleMouseButtonEvent(true, event.u.mouse); 123 pih->HandleMouseButtonEvent(true, event.u.mouse);
124 break; 124 return true;
125
125 case PP_EVENT_TYPE_MOUSEUP: 126 case PP_EVENT_TYPE_MOUSEUP:
126 pih->HandleMouseButtonEvent(false, event.u.mouse); 127 pih->HandleMouseButtonEvent(false, event.u.mouse);
127 break; 128 return true;
129
128 case PP_EVENT_TYPE_MOUSEMOVE: 130 case PP_EVENT_TYPE_MOUSEMOVE:
129 case PP_EVENT_TYPE_MOUSEENTER: 131 case PP_EVENT_TYPE_MOUSEENTER:
130 case PP_EVENT_TYPE_MOUSELEAVE: 132 case PP_EVENT_TYPE_MOUSELEAVE:
131 pih->HandleMouseMoveEvent(event.u.mouse); 133 pih->HandleMouseMoveEvent(event.u.mouse);
132 break; 134 return true;
133 135
134 case PP_EVENT_TYPE_KEYDOWN: 136 case PP_EVENT_TYPE_KEYDOWN:
137 case PP_EVENT_TYPE_KEYUP:
138 pih->HandleKeyEvent(event.type == PP_EVENT_TYPE_KEYDOWN, event.u.key);
139 return true;
140
135 case PP_EVENT_TYPE_CHAR: 141 case PP_EVENT_TYPE_CHAR:
136 // client_->handle_char_event(npevent); 142 pih->HandleCharacterEvent(event.u.character);
137 break; 143 return true;
138 144
139 default: 145 default:
140 break; 146 break;
141 } 147 }
142 148
143 return false; 149 return false;
144 } 150 }
145 151
146 pp::Var ChromotingInstance::GetInstanceObject() { 152 pp::Var ChromotingInstance::GetInstanceObject() {
147 LOG(ERROR) << "Getting instance object."; 153 LOG(ERROR) << "Getting instance object.";
148 if (instance_object_.is_void()) { 154 if (instance_object_.is_void()) {
149 ChromotingScriptableObject* object = new ChromotingScriptableObject(this); 155 ChromotingScriptableObject* object = new ChromotingScriptableObject(this);
150 object->Init(); 156 object->Init();
151 157
152 LOG(ERROR) << "Object initted."; 158 LOG(ERROR) << "Object initted.";
153 // The pp::Var takes ownership of object here. 159 // The pp::Var takes ownership of object here.
154 instance_object_ = pp::Var(object); 160 instance_object_ = pp::Var(object);
155 } 161 }
156 162
157 return instance_object_; 163 return instance_object_;
158 } 164 }
159 165
160 } // namespace remoting 166 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/client/input_handler.cc ('k') | remoting/client/plugin/pepper_input_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698