| 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 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 @end | 31 @end |
| 32 | 32 |
| 33 @implementation HotKeyMonitor | 33 @implementation HotKeyMonitor |
| 34 | 34 |
| 35 - (id)initWithHost:(remoting::ChromotingHost*)host { | 35 - (id)initWithHost:(remoting::ChromotingHost*)host { |
| 36 if ((self = [super init])) { | 36 if ((self = [super init])) { |
| 37 host_ = host; | 37 host_ = host; |
| 38 GTMCarbonEventDispatcherHandler* handler = | 38 GTMCarbonEventDispatcherHandler* handler = |
| 39 [GTMCarbonEventDispatcherHandler sharedEventDispatcherHandler]; | 39 [GTMCarbonEventDispatcherHandler sharedEventDispatcherHandler]; |
| 40 hot_key_ = [handler registerHotKey:kEscKeyCode | 40 hot_key_ = [handler registerHotKey:kEscKeyCode |
| 41 modifiers:NSShiftKeyMask | 41 modifiers:(NSAlternateKeyMask | NSControlKeyMask) |
| 42 target:self | 42 target:self |
| 43 action:@selector(hotKeyHit:) | 43 action:@selector(hotKeyHit:) |
| 44 userInfo:nil | 44 userInfo:nil |
| 45 whenPressed:YES]; | 45 whenPressed:YES]; |
| 46 if (!hot_key_) { | 46 if (!hot_key_) { |
| 47 [self release]; | 47 [self release]; |
| 48 return nil; | 48 return nil; |
| 49 } | 49 } |
| 50 } | 50 } |
| 51 return self; | 51 return self; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 92 |
| 93 void LocalInputMonitorMac::Stop() { | 93 void LocalInputMonitorMac::Stop() { |
| 94 [hot_key_monitor_ invalidate]; | 94 [hot_key_monitor_ invalidate]; |
| 95 [hot_key_monitor_ release]; | 95 [hot_key_monitor_ release]; |
| 96 hot_key_monitor_ = nil; | 96 hot_key_monitor_ = nil; |
| 97 } | 97 } |
| 98 | 98 |
| 99 remoting::LocalInputMonitor* remoting::LocalInputMonitor::Create() { | 99 remoting::LocalInputMonitor* remoting::LocalInputMonitor::Create() { |
| 100 return new LocalInputMonitorMac; | 100 return new LocalInputMonitorMac; |
| 101 } | 101 } |
| OLD | NEW |