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/host/event_executor.h" | 5 #include "remoting/host/event_executor.h" |
6 | 6 |
7 #include <ApplicationServices/ApplicationServices.h> | 7 #include <ApplicationServices/ApplicationServices.h> |
8 #include <Carbon/Carbon.h> | 8 #include <Carbon/Carbon.h> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 } | 224 } |
225 } | 225 } |
226 | 226 |
227 void EventExecutorMac::InjectMouseEvent(const MouseEvent& event) { | 227 void EventExecutorMac::InjectMouseEvent(const MouseEvent& event) { |
228 if (event.has_x() && event.has_y()) { | 228 if (event.has_x() && event.has_y()) { |
229 // TODO(wez): Checking the validity of the MouseEvent should be done in core | 229 // TODO(wez): Checking the validity of the MouseEvent should be done in core |
230 // cross-platform code, not here! | 230 // cross-platform code, not here! |
231 // TODO(wez): This code assumes that MouseEvent(0,0) (top-left of client vie
w) | 231 // TODO(wez): This code assumes that MouseEvent(0,0) (top-left of client vie
w) |
232 // corresponds to local (0,0) (top-left of primary monitor). That won't in | 232 // corresponds to local (0,0) (top-left of primary monitor). That won't in |
233 // general be true on multi-monitor systems, though. | 233 // general be true on multi-monitor systems, though. |
234 gfx::Size size = capturer_->size_most_recent(); | 234 SkISize size = capturer_->size_most_recent(); |
235 if (event.x() >= 0 || event.y() >= 0 || | 235 if (event.x() >= 0 || event.y() >= 0 || |
236 event.x() < size.width() || event.y() < size.height()) { | 236 event.x() < size.width() || event.y() < size.height()) { |
237 VLOG(3) << "Moving mouse to " << event.x() << "," << event.y(); | 237 VLOG(3) << "Moving mouse to " << event.x() << "," << event.y(); |
238 last_x_ = event.x(); | 238 last_x_ = event.x(); |
239 last_y_ = event.y(); | 239 last_y_ = event.y(); |
240 } else { | 240 } else { |
241 VLOG(1) << "Invalid mouse position " << event.x() << "," << event.y(); | 241 VLOG(1) << "Invalid mouse position " << event.x() << "," << event.y(); |
242 } | 242 } |
243 } | 243 } |
244 if (event.has_button() && event.has_button_down()) { | 244 if (event.has_button() && event.has_button_down()) { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 } | 279 } |
280 | 280 |
281 } // namespace | 281 } // namespace |
282 | 282 |
283 EventExecutor* EventExecutor::Create(MessageLoop* message_loop, | 283 EventExecutor* EventExecutor::Create(MessageLoop* message_loop, |
284 Capturer* capturer) { | 284 Capturer* capturer) { |
285 return new EventExecutorMac(message_loop, capturer); | 285 return new EventExecutorMac(message_loop, capturer); |
286 } | 286 } |
287 | 287 |
288 } // namespace remoting | 288 } // namespace remoting |
OLD | NEW |