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

Side by Side Diff: remoting/host/local_input_monitor_mac.mm

Issue 8190001: Fixed Mac hotkey. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 9 years, 2 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 | « no previous file | no next file » | 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) 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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698