Chromium Code Reviews| Index: ui/views/controls/textfield/textfield_unittest.cc |
| diff --git a/ui/views/controls/textfield/textfield_unittest.cc b/ui/views/controls/textfield/textfield_unittest.cc |
| index 4786bf1ed8b42e7287e028717f636d260e4b03eb..23d222485f943e6f57cd632c0aef7756014448d9 100644 |
| --- a/ui/views/controls/textfield/textfield_unittest.cc |
| +++ b/ui/views/controls/textfield/textfield_unittest.cc |
| @@ -330,6 +330,11 @@ class TextfieldDestroyerController : public views::TextfieldController { |
| const ui::KeyEvent& key_event) override { |
| if (target_) |
| target_->OnBlur(); |
| + // Removal of the Textfield must be done manually here since |
| + // Textfield::ViewHierarchyChanged() needs to be executed. Allowing View to |
| + // do it in its destructor instead (which calls RemoveChildView()) means |
| + // only View::ViewHierarchyChanged() is called. |
|
tapted
2016/10/31 00:30:25
This is a great comment, and a nice find. Things l
Patti Lor
2016/11/02 03:19:48
Thank you! :))
|
| + target_->parent()->RemoveChildView(target_.get()); |
| target_.reset(); |
| return false; |
| } |