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

Side by Side Diff: chrome/browser/ui/panels/panel_utils_cocoa.mm

Issue 9616037: Change panel drag related methods to use mouse location in screen coordinates. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch to reland Created 8 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #import "chrome/browser/ui/panels/panel_utils_cocoa.h"
6
7 namespace cocoa_utils {
8
9 NSRect ConvertRectToCocoaCoordinates(const gfx::Rect& bounds) {
10 // Flip coordinates based on the primary screen.
11 NSScreen* screen = [[NSScreen screens] objectAtIndex:0];
12
13 return NSMakeRect(
14 bounds.x(), NSHeight([screen frame]) - bounds.height() - bounds.y(),
15 bounds.width(), bounds.height());
16 }
17
18 NSPoint ConvertPointToCocoaCoordinates(const gfx::Point& point) {
19 // Flip coordinates based on the primary screen.
20 NSScreen* screen = [[NSScreen screens] objectAtIndex:0];
21
22 return NSMakePoint(point.x(), NSHeight([screen frame]) - point.y());
23 }
24
25 gfx::Point ConvertPointFromCocoaCoordinates(NSPoint point) {
26 // Flip coordinates based on the primary screen.
27 NSScreen* screen = [[NSScreen screens] objectAtIndex:0];
28
29 return gfx::Point(point.x, NSHeight([screen frame]) - point.y);
30 }
31
32 } // namespace cocoa_utils
OLDNEW
« no previous file with comments | « chrome/browser/ui/panels/panel_utils_cocoa.h ('k') | chrome/browser/ui/panels/panel_window_controller_cocoa.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698