From f0b34eb57afd73e5851d1fbe02351102ee87bfc0 Mon Sep 17 00:00:00 2001 From: "pinkerton@chromium.org" Date: Fri, 19 Jun 2009 17:08:06 +0000 Subject: Make escape close the prefs window. BUG=none TEST=fields in the middle of being editing should not save the value. Review URL: http://codereview.chromium.org/131113 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18821 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/cocoa/preferences_window_controller.mm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'chrome/browser/cocoa') diff --git a/chrome/browser/cocoa/preferences_window_controller.mm b/chrome/browser/cocoa/preferences_window_controller.mm index 1763262..8e14a50 100644 --- a/chrome/browser/cocoa/preferences_window_controller.mm +++ b/chrome/browser/cocoa/preferences_window_controller.mm @@ -204,6 +204,13 @@ class PrefObserverBridge : public NotificationObserver { context:context]; } +// Called when the user hits the escape key. Closes the window. This will +// automatically abandon/cancel any in-progress edits in text fields, we don't +// have to do anything special. +- (void)cancel:(id)sender { + [window performClose:self]; +} + // Record the user performed a certain action and save the preferences. - (void)recordUserAction:(const wchar_t*)action { UserMetrics::RecordComputedAction(action, profile_); -- cgit v1.1