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

Side by Side Diff: ui/base/cocoa/command_dispatcher.mm

Issue 1777653002: Prepare ui/ module for compilation with OS X 10.7 deployment target. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More compile errors. Created 4 years, 9 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 | « ui/base/cocoa/cocoa_base_utils.mm ('k') | ui/base/layout_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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #import "ui/base/cocoa/command_dispatcher.h" 5 #import "ui/base/cocoa/command_dispatcher.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/base/cocoa/cocoa_base_utils.h"
8 9
9 namespace { 10 namespace {
10 11
11 // Duplicate the given key event, but changing the associated window. 12 // Duplicate the given key event, but changing the associated window.
12 NSEvent* KeyEventForWindow(NSWindow* window, NSEvent* event) { 13 NSEvent* KeyEventForWindow(NSWindow* window, NSEvent* event) {
13 NSEventType event_type = [event type]; 14 NSEventType event_type = [event type];
14 15
15 // Convert the event's location from the original window's coordinates into 16 // Convert the event's location from the original window's coordinates into
16 // our own. 17 // our own.
17 NSPoint location = [event locationInWindow]; 18 NSPoint location = [event locationInWindow];
18 location = [[event window] convertBaseToScreen:location]; 19 location = ui::ConvertPointFromWindowToScreen([event window], location);
19 location = [window convertScreenToBase:location]; 20 location = ui::ConvertPointFromScreenToWindow(window, location);
20 21
21 // Various things *only* apply to key down/up. 22 // Various things *only* apply to key down/up.
22 bool is_a_repeat = false; 23 bool is_a_repeat = false;
23 NSString* characters = nil; 24 NSString* characters = nil;
24 NSString* charactors_ignoring_modifiers = nil; 25 NSString* charactors_ignoring_modifiers = nil;
25 if (event_type == NSKeyDown || event_type == NSKeyUp) { 26 if (event_type == NSKeyDown || event_type == NSKeyUp) {
26 is_a_repeat = [event isARepeat]; 27 is_a_repeat = [event isARepeat];
27 characters = [event characters]; 28 characters = [event characters];
28 charactors_ignoring_modifiers = [event charactersIgnoringModifiers]; 29 charactors_ignoring_modifiers = [event charactersIgnoringModifiers];
29 } 30 }
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 // If we get here, then the event was not handled by NSApplication. 122 // If we get here, then the event was not handled by NSApplication.
122 eventHandled_ = NO; 123 eventHandled_ = NO;
123 // Return YES to stop native -sendEvent handling. 124 // Return YES to stop native -sendEvent handling.
124 return YES; 125 return YES;
125 } 126 }
126 127
127 return NO; 128 return NO;
128 } 129 }
129 130
130 @end 131 @end
OLDNEW
« no previous file with comments | « ui/base/cocoa/cocoa_base_utils.mm ('k') | ui/base/layout_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698