summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/preferences_window_controller.h
diff options
context:
space:
mode:
authorpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-06 19:41:37 +0000
committerpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-06 19:41:37 +0000
commitcd63ef62b897937521c6943b554608b3f9349d27 (patch)
treec79b4ff66eb7d1553095a6389c41f85bca9f2051 /chrome/browser/cocoa/preferences_window_controller.h
parent8e80744e557dd436dd174b7f7203b4409b90c6e4 (diff)
downloadchromium_src-cd63ef62b897937521c6943b554608b3f9349d27.zip
chromium_src-cd63ef62b897937521c6943b554608b3f9349d27.tar.gz
chromium_src-cd63ef62b897937521c6943b554608b3f9349d27.tar.bz2
Implement most of the "basics" pref panel on Mac, including code to set the default browser. Fix up some related comments around the code.
Review URL: http://codereview.chromium.org/113032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15445 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/preferences_window_controller.h')
-rw-r--r--chrome/browser/cocoa/preferences_window_controller.h47
1 files changed, 42 insertions, 5 deletions
diff --git a/chrome/browser/cocoa/preferences_window_controller.h b/chrome/browser/cocoa/preferences_window_controller.h
index 1b1fd28..1f24b75 100644
--- a/chrome/browser/cocoa/preferences_window_controller.h
+++ b/chrome/browser/cocoa/preferences_window_controller.h
@@ -4,19 +4,56 @@
#import <Cocoa/Cocoa.h>
+#include "base/scoped_ptr.h"
+#include "base/scoped_nsobject.h"
+#include "chrome/common/pref_member.h"
+
+class PrefObserverBridge;
class PrefService;
+class Profile;
+@class StartupURLDataSource;
-// A window controller that handles the preferences window.
+// A window controller that handles the preferences window. The bulk of the
+// work is handled via Cocoa Bindings and getter/setter methods that wrap
+// cross-platform PrefMember objects. When prefs change in the back-end
+// (that is, outside of this UI), our observer recieves a notification and can
+// tickle the KVO to update the UI so we are always in sync. The bindings are
+// specified in the nib file. Preferences are persisted into the back-end
+// as they are changed in the UI, and are thus immediately available even while
+// the window is still open. When the window closes, a notification is sent
+// via the system NotificationCenter. This can be used as a signal to
+// release this controller, as it's likely the client wants to enforce there
+// only being one (we don't do that internally as it makes it very difficult
+// to unit test).
@interface PreferencesWindowController : NSWindowController {
@private
- PrefService* prefs_; // weak ref
+ Profile* profile_; // weak ref
+ PrefService* prefs_; // weak ref - Obtained from profile_ for convenience.
+ scoped_ptr<PrefObserverBridge> observer_; // Watches for pref changes.
+
+ // Basics panel
+ IntegerPrefMember restoreOnStartup_;
+ scoped_nsobject<StartupURLDataSource> customPagesSource_;
+ BooleanPrefMember newTabPageIsHomePage_;
+ StringPrefMember homepage_;
+ BooleanPrefMember showHomeButton_;
+ BooleanPrefMember showPageOptionButtons_;
+
+ // Minor Tweaks panel
+
+ // Under the hood panel
}
-// Designated initializer. |prefs| should not be NULL.
-- (id)initWithPrefs:(PrefService*)prefs;
+// Designated initializer. |profile| should not be NULL.
+- (id)initWithProfile:(Profile*)profile;
// Show the preferences window.
-- (IBAction)showPreferences:(id)sender;
+- (void)showPreferences:(id)sender;
+
+// IBAction methods for responding to user actions.
+
+// Basics panel
+- (IBAction)makeDefaultBrowser:(id)sender;
@end