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

Unified Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller.mm

Issue 2950523003: [Mac] Fix for Dialog Textfields (Closed)
Patch Set: Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller.mm
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller.mm
index f97970d7d52e47f8c5473468064d9361e1c2e34a..10b5c8b5911555a1fb011218b68d7473dd2fba2b 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller.mm
@@ -82,17 +82,25 @@ using bookmarks::BookmarkNode;
[self bookmarkModel]->expanded_state_tracker()->GetExpandedNodes()];
}
+- (void)windowWillClose:(NSNotification*)notification {
+ // Force the field editors to resign the first responder so that they'll
+ // be removed from the view hierarchy and its delegate be set to nil.
+ [[self window] endEditingFor:urlField_];
+ [[self window] endEditingFor:nameTextField_];
+
+ [super windowWillClose:notification];
+}
+
- (id)windowWillReturnFieldEditor:(NSWindow*)sender toObject:(id)obj {
if (obj == urlField_) {
if (!urlFieldEditor_)
urlFieldEditor_.reset([[DialogTextFieldEditor alloc] init]);
-
- return urlFieldEditor_.autorelease();
+ return urlFieldEditor_.get();
} else if (obj == nameTextField_) {
if (!nameFieldEditor_)
nameFieldEditor_.reset([[DialogTextFieldEditor alloc] init]);
- return nameFieldEditor_.autorelease();
+ return nameFieldEditor_.get();
}
return nil;
« no previous file with comments | « chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698