OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 | 6 |
7 #import "chrome/browser/ui/cocoa/window_size_autosaver.h" | 7 #import "chrome/browser/ui/cocoa/window_size_autosaver.h" |
8 | 8 |
9 #include "chrome/browser/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 10 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
11 | 11 |
12 // If the window width stored in the prefs is smaller than this, the size is | 12 // If the window width stored in the prefs is smaller than this, the size is |
13 // not restored but instead cleared from the profile -- to protect users from | 13 // not restored but instead cleared from the profile -- to protect users from |
14 // accidentally making their windows very small and then not finding them again. | 14 // accidentally making their windows very small and then not finding them again. |
15 const int kMinWindowWidth = 101; | 15 const int kMinWindowWidth = 101; |
16 | 16 |
17 // Minimum restored window height, see |kMinWindowWidth|. | 17 // Minimum restored window height, see |kMinWindowWidth|. |
18 const int kMinWindowHeight = 17; | 18 const int kMinWindowHeight = 17; |
19 | 19 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 !windowPrefs->GetInteger("y", &y)) | 103 !windowPrefs->GetInteger("y", &y)) |
104 return; // Nothing stored. | 104 return; // Nothing stored. |
105 // Turn the origin (lower-left) into an upper-left window point. | 105 // Turn the origin (lower-left) into an upper-left window point. |
106 NSPoint upperLeft = NSMakePoint(x, y + NSHeight([window_ frame])); | 106 NSPoint upperLeft = NSMakePoint(x, y + NSHeight([window_ frame])); |
107 [window_ cascadeTopLeftFromPoint:upperLeft]; | 107 [window_ cascadeTopLeftFromPoint:upperLeft]; |
108 } | 108 } |
109 } | 109 } |
110 | 110 |
111 @end | 111 @end |
112 | 112 |
OLD | NEW |