Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #import "chrome/browser/ui/cocoa/window_restore_utils.h" | |
| 6 | |
| 7 #import <Foundation/Foundation.h> | |
| 8 | |
| 9 #include "base/mac/mac_util.h" | |
| 10 | |
| 11 namespace restore_utils { | |
| 12 | |
| 13 bool IsWindowRestoreEnabled() { | |
| 14 if (!base::mac::IsOSLionOrLater()) | |
| 15 return false; | |
| 16 | |
| 17 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; | |
| 18 // The defaults must be synchronized here otherwise a stale value will be | |
| 19 // returned for an indeterminate amount of time. | |
| 20 [defaults synchronize]; | |
| 21 return !![defaults boolForKey:@"NSQuitAlwaysKeepsWindows"]; | |
|
Robert Sesek
2011/07/29 21:33:16
Dave, take a look at http://codereview.chromium.or
| |
| 22 } | |
| 23 | |
| 24 } // namespace restore_utils | |
| OLD | NEW |