summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/preferences_window_controller.mm
diff options
context:
space:
mode:
authorpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-30 19:23:58 +0000
committerpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-30 19:23:58 +0000
commit767543dfe21880d26ea805ab6eaf4147ac4c2351 (patch)
treeda880cc189e8cca09cb89e0f5c0329f462f5d85a /chrome/browser/cocoa/preferences_window_controller.mm
parent1aba390ce0ae355c82a3eb0e468926ad29e27484 (diff)
downloadchromium_src-767543dfe21880d26ea805ab6eaf4147ac4c2351.zip
chromium_src-767543dfe21880d26ea805ab6eaf4147ac4c2351.tar.gz
chromium_src-767543dfe21880d26ea805ab6eaf4147ac4c2351.tar.bz2
Add notification (and unit test) for closing prefs window so it can be cleaned up properly in the app controller. Make the prefs window controller the window's delegate so it gets close notifications.
Review URL: http://codereview.chromium.org/99238 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14967 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/preferences_window_controller.mm')
-rw-r--r--chrome/browser/cocoa/preferences_window_controller.mm8
1 files changed, 5 insertions, 3 deletions
diff --git a/chrome/browser/cocoa/preferences_window_controller.mm b/chrome/browser/cocoa/preferences_window_controller.mm
index 941d6b3..632e9cc 100644
--- a/chrome/browser/cocoa/preferences_window_controller.mm
+++ b/chrome/browser/cocoa/preferences_window_controller.mm
@@ -7,7 +7,8 @@
#include "base/mac_util.h"
#include "chrome/common/pref_service.h"
-PreferencesWindowController* gPrefWindowSingleton = nil;
+NSString* const kUserDoneEditingPrefsNotification =
+ @"kUserDoneEditingPrefsNotification";
@implementation PreferencesWindowController
@@ -42,8 +43,9 @@ PreferencesWindowController* gPrefWindowSingleton = nil;
// Called when the window is being closed. Send out a notification that the
// user is done editing preferences.
- (void)windowWillClose:(NSNotification *)notification {
- // TODO(pinkerton): send notification. Write unit test that makes sure
- // we receive it.
+ [[NSNotificationCenter defaultCenter]
+ postNotificationName:kUserDoneEditingPrefsNotification
+ object:self];
}
@end