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

Unified Diff: chrome/browser/ui/cocoa/nsview_additions.mm

Issue 10908074: mac: Use convertSizeFromBacking: instead of the deprecated ...FromBase: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/base/layout_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/nsview_additions.mm
diff --git a/chrome/browser/ui/cocoa/nsview_additions.mm b/chrome/browser/ui/cocoa/nsview_additions.mm
index b97ef236cef1c88ec5b09ab7940b8b3473729f82..9189eba11c5c6af75a863bb8f9578eff1db36b87 100644
--- a/chrome/browser/ui/cocoa/nsview_additions.mm
+++ b/chrome/browser/ui/cocoa/nsview_additions.mm
@@ -4,12 +4,22 @@
#import "chrome/browser/ui/cocoa/nsview_additions.h"
+#if !defined(MAC_OS_X_VERSION_10_7) || \
+ MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
+
+@interface (LionAPI)
+- (NSSize)convertSizeFromBacking:(NSSize)size;
+@end
+
+#endif // 10.7
+
@implementation NSView (ChromeAdditions)
- (CGFloat)cr_lineWidth {
- // NOTE: This is a correct use of base coordinate system, to perform pixel
- // alignment.
- return [self convertSizeFromBase:NSMakeSize(1, 1)].width;
+ // All shipping retina macs run at least 10.7.
Avi (use Gerrit) 2012/09/04 20:17:23 therefore, that's the minimum system we support Hi
+ if (![self respondsToSelector:@selector(convertSizeFromBacking:)])
+ return 1;
+ return [self convertSizeFromBacking:NSMakeSize(1, 1)].width;
}
- (BOOL)cr_isMouseInView {
« no previous file with comments | « no previous file | ui/base/layout_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698