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

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

Issue 7522025: Turn on session restore by default for mac on Lion (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: JS nits and comment correction Created 9 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
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..22a3209764ae171aa2e8854651d2fa8db6bb6a66
--- /dev/null
+++ b/chrome/browser/ui/cocoa/window_restore_utils.mm
@@ -0,0 +1,24 @@
+// 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"
+
+#import <Foundation/Foundation.h>
+
+#include "base/mac/mac_util.h"
+
+namespace restore_utils {
+
+bool IsWindowRestoreEnabled() {
+ if (!base::mac::IsOSLionOrLater())
+ return false;
+
+ NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
+ // 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"];
Robert Sesek 2011/07/29 21:33:16 Dave, take a look at http://codereview.chromium.or
+}
+
+} // namespace restore_utils
« no previous file with comments | « chrome/browser/ui/cocoa/window_restore_utils.h ('k') | chrome/browser/ui/webui/options/browser_options_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698