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

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

Issue 7544037: Session restore by default should account for uninitialized state (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
index 22a3209764ae171aa2e8854651d2fa8db6bb6a66..133fa29db1377b68d58dc34df7cb7282e263285f 100644
--- a/chrome/browser/ui/cocoa/window_restore_utils.mm
+++ b/chrome/browser/ui/cocoa/window_restore_utils.mm
@@ -18,7 +18,15 @@ bool IsWindowRestoreEnabled() {
// 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"];
+
+ // By default, the preference is not set. When it's not, the intrinsic Lion
+ // default (YES) should be returned.
+ NSDictionary* prefs = [defaults dictionaryRepresentation];
+ NSNumber* value = [prefs objectForKey:@"NSQuitAlwaysKeepsWindows"];
+ if (!value)
+ return true;
+
+ return !![value boolValue];
}
} // namespace restore_utils
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698