diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-12 07:28:17 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-12 07:28:17 +0000 |
commit | 8050f2a8f3d1d98bc80ab4ccd5266c5bc6d0678f (patch) | |
tree | 8b3eecb5432b1df8582c7154bd65b6037e542916 /base/mac_util.mm | |
parent | 01dc650e2499dd966e4025a6022cdc6d82087c39 (diff) | |
download | chromium_src-8050f2a8f3d1d98bc80ab4ccd5266c5bc6d0678f.zip chromium_src-8050f2a8f3d1d98bc80ab4ccd5266c5bc6d0678f.tar.gz chromium_src-8050f2a8f3d1d98bc80ab4ccd5266c5bc6d0678f.tar.bz2 |
Mac: move should-double-click-to-minimize code into mac_util.
Also make the fullscreen code do the right thing in theory, even though it
doesn't work and I'll probably shortly remove it.
BUG=none
TEST=Double-clicking on the tab strip should or should not minimize the window according to the system prefs setting; click in the area beside the tabs.
Review URL: http://codereview.chromium.org/859004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41413 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/mac_util.mm')
-rw-r--r-- | base/mac_util.mm | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/base/mac_util.mm b/base/mac_util.mm index 3254661..5735aa3 100644 --- a/base/mac_util.mm +++ b/base/mac_util.mm @@ -230,6 +230,19 @@ void SetCursorVisibility(bool visible) { [NSCursor hide]; } +bool ShouldWindowsMiniaturizeOnDoubleClick() { + // We use an undocumented method in Cocoa; if it doesn't exist, default to + // |true|. If it ever goes away, we can do (using an undocumented pref key): + // NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; + // return ![defaults objectForKey:@"AppleMiniaturizeOnDoubleClick"] || + // [defaults boolForKey:@"AppleMiniaturizeOnDoubleClick"]; + BOOL methodImplemented = + [NSWindow respondsToSelector:@selector(_shouldMiniaturizeOnDoubleClick)]; + DCHECK(methodImplemented); + return !methodImplemented || + [NSWindow performSelector:@selector(_shouldMiniaturizeOnDoubleClick)]; +} + void GrabWindowSnapshot(NSWindow* window, std::vector<unsigned char>* png_representation) { // Make sure to grab the "window frame" view so we get current tab + |