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

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: 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..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

Powered by Google App Engine
This is Rietveld 408576698