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

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

Issue 402753002: mac: [Yosemite] Remove unnecessary AppKit private method swizzling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/custom_frame_view.mm
diff --git a/chrome/browser/ui/cocoa/custom_frame_view.mm b/chrome/browser/ui/cocoa/custom_frame_view.mm
index 2db6103c14ebf3b6f2e4d49efbdef7621f207b32..3628c1a29fbf83e24d4acabdaf0cbcb510ef9fc3 100644
--- a/chrome/browser/ui/cocoa/custom_frame_view.mm
+++ b/chrome/browser/ui/cocoa/custom_frame_view.mm
@@ -89,22 +89,26 @@ BOOL gCanGetCornerRadius = NO;
}
}
- // Swizzle the method that sets the origin for the Lion fullscreen button. Do
- // nothing if it cannot be found.
- m0 = class_getInstanceMethod([self class],
- @selector(_fullScreenButtonOrigin));
- if (m0) {
- BOOL didAdd = class_addMethod(borderViewClass,
- @selector(_fullScreenButtonOriginOriginal),
- method_getImplementation(m0),
- method_getTypeEncoding(m0));
- if (didAdd) {
- Method m1 = class_getInstanceMethod(borderViewClass,
- @selector(_fullScreenButtonOrigin));
- Method m2 = class_getInstanceMethod(borderViewClass,
- @selector(_fullScreenButtonOriginOriginal));
- if (m1 && m2) {
- method_exchangeImplementations(m1, m2);
+ // In Yosemite, the fullscreen button replaces the zoom button. We no longer
+ // need to swizzle out this AppKit private method.
+ if (base::mac::IsOSMavericksOrEarlier()) {
+ // Swizzle the method that sets the origin for the Lion fullscreen button.
+ // Do nothing if it cannot be found.
+ m0 = class_getInstanceMethod([self class],
+ @selector(_fullScreenButtonOrigin));
+ if (m0) {
+ BOOL didAdd = class_addMethod(borderViewClass,
+ @selector(_fullScreenButtonOriginOriginal),
+ method_getImplementation(m0),
+ method_getTypeEncoding(m0));
+ if (didAdd) {
+ Method m1 = class_getInstanceMethod(borderViewClass,
+ @selector(_fullScreenButtonOrigin));
+ Method m2 = class_getInstanceMethod(
+ borderViewClass, @selector(_fullScreenButtonOriginOriginal));
+ if (m1 && m2) {
+ method_exchangeImplementations(m1, m2);
+ }
}
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698