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

Unified Diff: ui/views/controls/textfield/textfield_unittest.cc

Issue 2345183002: Views: Draw Textfield selected text in gray when top-level Widget loses focus.
Patch Set: Fix rebase. Created 4 years, 2 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
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;
}

Powered by Google App Engine
This is Rietveld 408576698