Chromium Code Reviews| Index: ui/base/cocoa/appkit_utils.mm |
| diff --git a/ui/base/cocoa/appkit_utils.mm b/ui/base/cocoa/appkit_utils.mm |
| index 6aa90ae6789d1dcb58f9b87ee753d1576db4f1f0..66ae924e12963426672f2886667c40dc45e5bc28 100644 |
| --- a/ui/base/cocoa/appkit_utils.mm |
| +++ b/ui/base/cocoa/appkit_utils.mm |
| @@ -29,6 +29,22 @@ bool ShouldWindowsMiniaturizeOnDoubleClick() { |
| [NSWindow performSelector:@selector(_shouldMiniaturizeOnDoubleClick)]; |
| } |
| +// Whether windows should maximize on a double-click on the title bar. |
| +bool ShouldWindowsMaximizeOnDoubleClick() { |
| + // Pre-Yosmite the answer was "no." |
| + if (!base::mac::IsOSYosemiteOrLater()) { |
|
tapted
2016/01/17 23:53:18
nit: IsOSMavericksOrEarlier() ?
shrike
2016/01/19 19:34:23
I guess I like !IsOSYosemiteOrLater() because the
tapted
2016/01/19 22:16:34
Makes sense, and I agree with your point. (and I'm
shrike
2016/01/20 17:23:54
Yeah, that makes a lot of sense, and has nice symm
|
| + return false; |
| + } else if (base::mac::IsOSYosemite()) { |
| + return true; |
| + } |
| + |
| + // In El Capitan there's a Dock setting that governs the action. |
|
tapted
2016/01/17 23:53:18
nit: Maybe something like "El Capitan introduced a
shrike
2016/01/19 19:34:23
Good point. I added your comment language, and als
|
| + NSString* doubleClickAction = [[NSUserDefaults standardUserDefaults] |
| + objectForKey:@"AppleActionOnDoubleClick"]; |
| + |
| + return [doubleClickAction isEqualToString:@"Maximize"]; |
| +} |
| + |
| } // namespace |
| namespace ui { |
| @@ -56,7 +72,7 @@ void DrawNinePartImage(NSRect frame, |
| void WindowTitlebarReceivedDoubleClick(NSWindow* window, id sender) { |
| if (ShouldWindowsMiniaturizeOnDoubleClick()) { |
| [window performMiniaturize:sender]; |
| - } else if (base::mac::IsOSYosemiteOrLater()) { |
| + } else if (ShouldWindowsMaximizeOnDoubleClick()) { |
| [window performZoom:sender]; |
| } |
| } |