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 #import "chrome/browser/ui/cocoa/custom_frame_view.h" | 5 #import "chrome/browser/ui/cocoa/custom_frame_view.h" |
6 | 6 |
7 #import <Carbon/Carbon.h> | 7 #import <Carbon/Carbon.h> |
8 #include <crt_externs.h> | 8 #include <crt_externs.h> |
9 #import <objc/runtime.h> | 9 #import <objc/runtime.h> |
10 #include <string.h> | 10 #include <string.h> |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 const int argc = *_NSGetArgc(); | 43 const int argc = *_NSGetArgc(); |
44 const char kType[] = "--type="; | 44 const char kType[] = "--type="; |
45 for (int i = 1; i < argc; ++i) { | 45 for (int i = 1; i < argc; ++i) { |
46 const char* arg = argv[i]; | 46 const char* arg = argv[i]; |
47 if (strncmp(arg, kType, strlen(kType)) == 0) | 47 if (strncmp(arg, kType, strlen(kType)) == 0) |
48 return; | 48 return; |
49 } | 49 } |
50 | 50 |
51 // In Yosemite, the fullscreen button replaces the zoom button. We no longer | 51 // In Yosemite, the fullscreen button replaces the zoom button. We no longer |
52 // need to swizzle out this AppKit private method. | 52 // need to swizzle out this AppKit private method. |
53 if (!base::mac::IsOSMavericks()) | 53 if (!base::mac::IsOS10_9()) |
54 return; | 54 return; |
55 | 55 |
56 base::mac::ScopedNSAutoreleasePool pool; | 56 base::mac::ScopedNSAutoreleasePool pool; |
57 | 57 |
58 // On 10.8+ the background for textured windows are no longer drawn by | 58 // On 10.8+ the background for textured windows are no longer drawn by |
59 // NSGrayFrame, and NSThemeFrame is used instead <http://crbug.com/114745>. | 59 // NSGrayFrame, and NSThemeFrame is used instead <http://crbug.com/114745>. |
60 Class borderViewClass = NSClassFromString(@"NSThemeFrame"); | 60 Class borderViewClass = NSClassFromString(@"NSThemeFrame"); |
61 DCHECK(borderViewClass); | 61 DCHECK(borderViewClass); |
62 if (!borderViewClass) return; | 62 if (!borderViewClass) return; |
63 | 63 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 if ([window respondsToSelector:@selector(fullScreenButtonOriginAdjustment)]) | 102 if ([window respondsToSelector:@selector(fullScreenButtonOriginAdjustment)]) |
103 offset = [window fullScreenButtonOriginAdjustment]; | 103 offset = [window fullScreenButtonOriginAdjustment]; |
104 | 104 |
105 NSPoint origin = [self _fullScreenButtonOriginOriginal]; | 105 NSPoint origin = [self _fullScreenButtonOriginOriginal]; |
106 origin.x += offset.x; | 106 origin.x += offset.x; |
107 origin.y += offset.y; | 107 origin.y += offset.y; |
108 return origin; | 108 return origin; |
109 } | 109 } |
110 | 110 |
111 @end | 111 @end |
OLD | NEW |