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

Side by Side Diff: ui/gfx/mac/coordinate_conversion.mm

Issue 1280673003: [Mac] Enable MacViews site settings bubble behind --enable-mac-views-dialogs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@enabledialogs
Patch Set: Sync Created 5 years, 4 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
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 #import "ui/gfx/mac/coordinate_conversion.h" 5 #import "ui/gfx/mac/coordinate_conversion.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #include "ui/gfx/geometry/rect.h" 9 #include "ui/gfx/geometry/rect.h"
10 10
(...skipping 16 matching lines...) Expand all
27 rect.height()); 27 rect.height());
28 } 28 }
29 29
30 gfx::Rect ScreenRectFromNSRect(const NSRect& rect) { 30 gfx::Rect ScreenRectFromNSRect(const NSRect& rect) {
31 return gfx::Rect(rect.origin.x, 31 return gfx::Rect(rect.origin.x,
32 PrimaryDisplayHeight() - rect.origin.y - rect.size.height, 32 PrimaryDisplayHeight() - rect.origin.y - rect.size.height,
33 rect.size.width, 33 rect.size.width,
34 rect.size.height); 34 rect.size.height);
35 } 35 }
36 36
37 NSPoint ScreenPointToNSPoint(const gfx::Point& point) {
38 return NSMakePoint(point.x(), PrimaryDisplayHeight() - point.y());
39 }
40
41 gfx::Point ScreenPointFromNSPoint(const NSPoint& point) {
42 return gfx::Point(point.x, PrimaryDisplayHeight() - point.y);
43 }
44
37 } // namespace gfx 45 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698