summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/preferences_window_controller.mm
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-27 18:46:46 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-27 18:46:46 +0000
commit752e0e629c3018868f3edf7bc2cbbda66c7c6f45 (patch)
treec749572df704bf2a4bc6254674086944756e1727 /chrome/browser/cocoa/preferences_window_controller.mm
parent28b04e187d1757e2ad098524326bcefdfeb97108 (diff)
downloadchromium_src-752e0e629c3018868f3edf7bc2cbbda66c7c6f45.zip
chromium_src-752e0e629c3018868f3edf7bc2cbbda66c7c6f45.tar.gz
chromium_src-752e0e629c3018868f3edf7bc2cbbda66c7c6f45.tar.bz2
Fix a couple of bugs in the "custom home pages" list in the Preferences window.
1. It was possible to add empty rows to the list by repeatedly clicking the + button. 2. There was a crash when editing an existing item, clearing the text and pressing enter. CustomHomePagesEntry::setURL didn't handle a nil NSString passed to it in this condition. I added a controlTextDidEndEditing method to PreferencesWindowController that forces a revalidation of the contents of the model backing the TableView. http://crbug.com/19555 TEST=Click the + button below the custom home pages table view in the Basics page of Preferences. You should get an active edit but not add the item if you don't type anything. Also, try adding a few valid URLs, then click one to edit and delete the URL, then press enter. It should be removed from the table. See also attached unit test. Review URL: http://codereview.chromium.org/174173 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24635 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/preferences_window_controller.mm')
-rw-r--r--chrome/browser/cocoa/preferences_window_controller.mm4
1 files changed, 4 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/preferences_window_controller.mm b/chrome/browser/cocoa/preferences_window_controller.mm
index 372a4c6..400c6cd 100644
--- a/chrome/browser/cocoa/preferences_window_controller.mm
+++ b/chrome/browser/cocoa/preferences_window_controller.mm
@@ -938,4 +938,8 @@ const int kDisabledIndex = 1;
object:self];
}
+- (void)controlTextDidEndEditing:(NSNotification*)notification {
+ [customPagesSource_ validateURLs];
+}
+
@end