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

Side by Side Diff: chrome/browser/ui/cocoa/window_size_autosaver.mm

Issue 12211105: Move remaining non-test, non-Chrome-specific Prefs code to base/prefs/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments, merge to LKGR. Created 7 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/view_id_util_browsertest.mm ('k') | chrome/browser/ui/cocoa/window_size_autosaver_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698