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

Side by Side Diff: chrome/browser/cocoa/window_size_autosaver.h

Issue 536086: Mac: Save/restore task manager window pos and size. (Closed)
Patch Set: comments Created 10 years, 11 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
« no previous file with comments | « chrome/browser/cocoa/task_manager_mac.mm ('k') | chrome/browser/cocoa/window_size_autosaver.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_COCOA_WINDOW_SIZE_AUTOSAVER_H_
6 #define CHROME_BROWSER_COCOA_WINDOW_SIZE_AUTOSAVER_H_
7
8 class PrefService;
9 @class NSWindow;
10
11 enum WindowSizeAutosaverState {
12
13 // Autosave only the window's bottom-right corner.
14 kSaveWindowPos,
15
16 // Autosave the whole window rect, i.e. both position and size.
17 kSaveWindowRect,
18 };
19
20 // WindowSizeAutosaver is a helper class that makes it easy to let windows
21 // autoremember their position or position and size in a PrefService object.
22 // To use this, add a |scoped_nsobject<WindowSizeAutosaver>| to your window
23 // controller and initialize it in the window controller's init method, passing
24 // a window and an autosave name. The autosaver will register for "window moved"
25 // and "window resized" notifications and write the current window state to the
26 // prefs service every time they fire. The window's size is automatically
27 // restored when the autosaver's |initWithWindow:...| method is called.
Robert Sesek 2010/01/19 21:51:12 Maybe add a note about not having "Visible on laun
28 @interface WindowSizeAutosaver : NSObject {
29 NSWindow* window_; // weak
30 PrefService* prefService_; // weak
31 const wchar_t* path_;
32 WindowSizeAutosaverState state_;
33 }
34
35 - (id)initWithWindow:(NSWindow*)window
36 prefService:(PrefService*)prefs
37 path:(const wchar_t*)path
38 state:(WindowSizeAutosaverState)state;
39 @end
40
41 #endif // CHROME_BROWSER_COCOA_WINDOW_SIZE_AUTOSAVER_H_
42
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/task_manager_mac.mm ('k') | chrome/browser/cocoa/window_size_autosaver.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698