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/local_input_monitor.h" | 5 #include "remoting/host/local_input_monitor.h" |
6 | 6 |
7 #import <AppKit/AppKit.h> | 7 #import <AppKit/AppKit.h> |
8 #include <set> | 8 #include <set> |
9 | 9 |
| 10 #include "base/bind.h" |
10 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
11 #include "base/lazy_instance.h" | 12 #include "base/lazy_instance.h" |
12 #include "base/logging.h" | 13 #include "base/logging.h" |
13 #include "base/mac/scoped_cftyperef.h" | 14 #include "base/mac/scoped_cftyperef.h" |
14 #include "base/synchronization/lock.h" | 15 #include "base/synchronization/lock.h" |
15 #include "remoting/host/chromoting_host.h" | 16 #include "remoting/host/chromoting_host.h" |
16 #import "third_party/GTM/AppKit/GTMCarbonEvent.h" | 17 #import "third_party/GTM/AppKit/GTMCarbonEvent.h" |
17 | 18 |
18 // Esc Key Code is 53. | 19 // Esc Key Code is 53. |
19 // http://boredzo.org/blog/wp-content/uploads/2007/05/IMTx-virtual-keycodes.pdf | 20 // http://boredzo.org/blog/wp-content/uploads/2007/05/IMTx-virtual-keycodes.pdf |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 [self release]; | 93 [self release]; |
93 return nil; | 94 return nil; |
94 } | 95 } |
95 } | 96 } |
96 return self; | 97 return self; |
97 } | 98 } |
98 | 99 |
99 - (void)hotKeyHit:(GTMCarbonHotKey*)hotKey { | 100 - (void)hotKeyHit:(GTMCarbonHotKey*)hotKey { |
100 base::AutoLock lock(hostsLock_); | 101 base::AutoLock lock(hostsLock_); |
101 for (Hosts::const_iterator i = hosts_.begin(); i != hosts_.end(); ++i) { | 102 for (Hosts::const_iterator i = hosts_.begin(); i != hosts_.end(); ++i) { |
102 (*i)->Shutdown(NULL); | 103 (*i)->Shutdown(base::Closure()); |
103 } | 104 } |
104 } | 105 } |
105 | 106 |
106 - (void)localMouseMoved:(const SkIPoint&)mousePos { | 107 - (void)localMouseMoved:(const SkIPoint&)mousePos { |
107 base::AutoLock lock(hostsLock_); | 108 base::AutoLock lock(hostsLock_); |
108 for (Hosts::const_iterator i = hosts_.begin(); i != hosts_.end(); ++i) { | 109 for (Hosts::const_iterator i = hosts_.begin(); i != hosts_.end(); ++i) { |
109 (*i)->LocalMouseMoved(mousePos); | 110 (*i)->LocalMouseMoved(mousePos); |
110 } | 111 } |
111 } | 112 } |
112 | 113 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 if ([local_input_monitor removeHost:host_]) { | 178 if ([local_input_monitor removeHost:host_]) { |
178 [local_input_monitor invalidate]; | 179 [local_input_monitor invalidate]; |
179 [local_input_monitor release]; | 180 [local_input_monitor release]; |
180 local_input_monitor = nil; | 181 local_input_monitor = nil; |
181 } | 182 } |
182 } | 183 } |
183 | 184 |
184 remoting::LocalInputMonitor* remoting::LocalInputMonitor::Create() { | 185 remoting::LocalInputMonitor* remoting::LocalInputMonitor::Create() { |
185 return new LocalInputMonitorMac; | 186 return new LocalInputMonitorMac; |
186 } | 187 } |
OLD | NEW |