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

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: Refactor to use SelectionController(Delegate). Unfinished! Created 4 years, 1 month 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 | « ui/views/controls/textfield/textfield.cc ('k') | ui/views/focus/focus_traversal_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 55631ce38cb7aacbeb4908ea8b69f88166929adc..c25c4f443b35ded7e0487a8b6406752a12b4c8f6 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.
+ target_->parent()->RemoveChildView(target_.get());
target_.reset();
return false;
}
« no previous file with comments | « ui/views/controls/textfield/textfield.cc ('k') | ui/views/focus/focus_traversal_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698