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

Side by Side Diff: ui/base/cocoa/cocoa_base_utils.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.h ('k') | ui/base/cocoa/command_dispatcher.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/base/cocoa/cocoa_base_utils.h" 5 #include "ui/base/cocoa/cocoa_base_utils.h"
6 6
7 #include "base/mac/sdk_forward_declarations.h"
7 #include "ui/events/cocoa/cocoa_event_utils.h" 8 #include "ui/events/cocoa/cocoa_event_utils.h"
8 9
9 namespace ui { 10 namespace ui {
10 11
11 WindowOpenDisposition WindowOpenDispositionFromNSEvent(NSEvent* event) { 12 WindowOpenDisposition WindowOpenDispositionFromNSEvent(NSEvent* event) {
12 NSUInteger modifiers = [event modifierFlags]; 13 NSUInteger modifiers = [event modifierFlags];
13 return WindowOpenDispositionFromNSEventWithFlags(event, modifiers); 14 return WindowOpenDispositionFromNSEventWithFlags(event, modifiers);
14 } 15 }
15 16
16 WindowOpenDisposition WindowOpenDispositionFromNSEventWithFlags( 17 WindowOpenDisposition WindowOpenDispositionFromNSEventWithFlags(
17 NSEvent* event, NSUInteger modifiers) { 18 NSEvent* event, NSUInteger modifiers) {
18 int event_flags = EventFlagsFromNSEventWithModifiers(event, modifiers); 19 int event_flags = EventFlagsFromNSEventWithModifiers(event, modifiers);
19 return DispositionFromEventFlags(event_flags); 20 return DispositionFromEventFlags(event_flags);
20 } 21 }
21 22
23 NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) {
24 NSRect point_rect = NSMakeRect(point.x, point.y, 0, 0);
25 return [window convertRectToScreen:point_rect].origin;
26 }
27
28 NSPoint ConvertPointFromScreenToWindow(NSWindow* window, NSPoint point) {
29 NSRect point_rect = NSMakeRect(point.x, point.y, 0, 0);
30 return [window convertRectFromScreen:point_rect].origin;
31 }
32
22 } // namespace ui 33 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/cocoa/cocoa_base_utils.h ('k') | ui/base/cocoa/command_dispatcher.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698