OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CHROME_BROWSER_UI_COCOA_PANELS_PANEL_UTILS_COCOA_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_PANELS_PANEL_UTILS_COCOA_H_ |
6 #define CHROME_BROWSER_UI_COCOA_PANELS_PANEL_UTILS_COCOA_H_ | 6 #define CHROME_BROWSER_UI_COCOA_PANELS_PANEL_UTILS_COCOA_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 #include "ui/gfx/point.h" | 9 #include "ui/gfx/geometry/point.h" |
10 #include "ui/gfx/rect.h" | 10 #include "ui/gfx/rect.h" |
11 | 11 |
12 namespace cocoa_utils { | 12 namespace cocoa_utils { |
13 | 13 |
14 // TODO(dcheng): Move elsewhere so BrowserWindowCocoa can use them too. | 14 // TODO(dcheng): Move elsewhere so BrowserWindowCocoa can use them too. |
15 // Converts a rect from the platform-independent screen coordinates (with the | 15 // Converts a rect from the platform-independent screen coordinates (with the |
16 // (0,0) in the top-left corner of the primary screen) to the Cocoa screen | 16 // (0,0) in the top-left corner of the primary screen) to the Cocoa screen |
17 // coordinates (with (0,0) in the low-left corner). | 17 // coordinates (with (0,0) in the low-left corner). |
18 NSRect ConvertRectToCocoaCoordinates(const gfx::Rect& bounds); | 18 NSRect ConvertRectToCocoaCoordinates(const gfx::Rect& bounds); |
19 | 19 |
20 // Converts a rect from the Cocoa screen oordinates (with (0,0) in the low-left | 20 // Converts a rect from the Cocoa screen oordinates (with (0,0) in the low-left |
21 // corner) to the platform-independent screen coordinates (with the (0,0) in | 21 // corner) to the platform-independent screen coordinates (with the (0,0) in |
22 // the top-left corner of the primary screen). | 22 // the top-left corner of the primary screen). |
23 gfx::Rect ConvertRectFromCocoaCoordinates(NSRect bounds); | 23 gfx::Rect ConvertRectFromCocoaCoordinates(NSRect bounds); |
24 | 24 |
25 // Converts a point from the platform-independent screen coordinates (with the | 25 // Converts a point from the platform-independent screen coordinates (with the |
26 // (0,0) in the top-left corner of the primary screen) to the Cocoa screen | 26 // (0,0) in the top-left corner of the primary screen) to the Cocoa screen |
27 // coordinates (with (0,0) in the low-left corner). | 27 // coordinates (with (0,0) in the low-left corner). |
28 NSPoint ConvertPointToCocoaCoordinates(const gfx::Point& point); | 28 NSPoint ConvertPointToCocoaCoordinates(const gfx::Point& point); |
29 | 29 |
30 // Converts a point from the Cocoa screen coordinates (with (0,0) in the | 30 // Converts a point from the Cocoa screen coordinates (with (0,0) in the |
31 // low-left corner of the primary screen) to the platform-independent screen | 31 // low-left corner of the primary screen) to the platform-independent screen |
32 // coordinates (with the (0,0) in the top-left corner). | 32 // coordinates (with the (0,0) in the top-left corner). |
33 gfx::Point ConvertPointFromCocoaCoordinates(NSPoint point); | 33 gfx::Point ConvertPointFromCocoaCoordinates(NSPoint point); |
34 | 34 |
35 } // namespace cocoa_utils | 35 } // namespace cocoa_utils |
36 | 36 |
37 #endif // CHROME_BROWSER_UI_COCOA_PANELS_PANEL_UTILS_COCOA_H_ | 37 #endif // CHROME_BROWSER_UI_COCOA_PANELS_PANEL_UTILS_COCOA_H_ |
OLD | NEW |