Chromium Code Reviews| Index: chrome/browser/ui/cocoa/window_restore_utils.mm |
| diff --git a/chrome/browser/ui/cocoa/window_restore_utils.mm b/chrome/browser/ui/cocoa/window_restore_utils.mm |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c2dbb8dd4448e5671f455af10f9b4d7cf2dedfd7 |
| --- /dev/null |
| +++ b/chrome/browser/ui/cocoa/window_restore_utils.mm |
| @@ -0,0 +1,22 @@ |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#import "chrome/browser/ui/cocoa/window_restore_utils.h" |
| + |
| +#include "base/mac/mac_util.h" |
| + |
| +namespace restore_utils { |
| + |
| +bool IsWindowRestoreEnabled() { |
| + if (!base::mac::IsOSLionOrLater()) |
| + return false; |
| + |
| + NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; |
|
Robert Sesek
2011/07/28 18:30:22
Need to #import Foundation
dhollowa
2011/07/28 20:05:35
Done.
|
| + // The defaults must be synchronized here otherwise a stale value will be |
| + // returned for an indeterminate amount of time. |
| + [defaults synchronize]; |
| + return !![defaults boolForKey:@"NSQuitAlwaysKeepsWindows"]; |
| +} |
| + |
| +} // namespace restore_utils |