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

Side by Side Diff: remoting/host/input_injector_mac.cc

Issue 16917011: mac: Replace base::mac::ScopedCFTypeRef with base::ScopedCFTypeRef. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: with fixed off-by-1 in git-clang-format Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « remoting/host/desktop_resizer_mac.cc ('k') | remoting/host/local_input_monitor_mac.mm » ('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) 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/host/input_injector.h" 5 #include "remoting/host/input_injector.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <ApplicationServices/ApplicationServices.h> 8 #include <ApplicationServices/ApplicationServices.h>
9 #include <Carbon/Carbon.h> 9 #include <Carbon/Carbon.h>
10 10
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 (mouse_button_state_ & LeftBit) != 0, 244 (mouse_button_state_ & LeftBit) != 0,
245 (mouse_button_state_ & RightBit) != 0, 245 (mouse_button_state_ & RightBit) != 0,
246 (mouse_button_state_ & MiddleBit) != 0); 246 (mouse_button_state_ & MiddleBit) != 0);
247 #pragma clang diagnostic pop 247 #pragma clang diagnostic pop
248 if (error != kCGErrorSuccess) 248 if (error != kCGErrorSuccess)
249 LOG(WARNING) << "CGPostMouseEvent error " << error; 249 LOG(WARNING) << "CGPostMouseEvent error " << error;
250 250
251 if (event.has_wheel_delta_x() && event.has_wheel_delta_y()) { 251 if (event.has_wheel_delta_x() && event.has_wheel_delta_y()) {
252 int delta_x = static_cast<int>(event.wheel_delta_x()); 252 int delta_x = static_cast<int>(event.wheel_delta_x());
253 int delta_y = static_cast<int>(event.wheel_delta_y()); 253 int delta_y = static_cast<int>(event.wheel_delta_y());
254 base::mac::ScopedCFTypeRef<CGEventRef> event( 254 base::ScopedCFTypeRef<CGEventRef> event(CGEventCreateScrollWheelEvent(
255 CGEventCreateScrollWheelEvent( 255 NULL, kCGScrollEventUnitPixel, 2, delta_y, delta_x));
256 NULL, kCGScrollEventUnitPixel, 2, delta_y, delta_x));
257 if (event) 256 if (event)
258 CGEventPost(kCGSessionEventTap, event); 257 CGEventPost(kCGSessionEventTap, event);
259 } 258 }
260 } 259 }
261 260
262 void InputInjectorMac::Core::Start( 261 void InputInjectorMac::Core::Start(
263 scoped_ptr<protocol::ClipboardStub> client_clipboard) { 262 scoped_ptr<protocol::ClipboardStub> client_clipboard) {
264 if (!task_runner_->BelongsToCurrentThread()) { 263 if (!task_runner_->BelongsToCurrentThread()) {
265 task_runner_->PostTask( 264 task_runner_->PostTask(
266 FROM_HERE, 265 FROM_HERE,
(...skipping 18 matching lines...) Expand all
285 284
286 } // namespace 285 } // namespace
287 286
288 scoped_ptr<InputInjector> InputInjector::Create( 287 scoped_ptr<InputInjector> InputInjector::Create(
289 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, 288 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
290 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { 289 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) {
291 return scoped_ptr<InputInjector>(new InputInjectorMac(main_task_runner)); 290 return scoped_ptr<InputInjector>(new InputInjectorMac(main_task_runner));
292 } 291 }
293 292
294 } // namespace remoting 293 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/desktop_resizer_mac.cc ('k') | remoting/host/local_input_monitor_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698