Index: ui/views/controls/textfield/textfield.cc |
diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc |
index 24eb8bde75bfe042cad79c4c2737a829e0f117fd..8a71b052247f9a56415209a8500366a1966882cc 100644 |
--- a/ui/views/controls/textfield/textfield.cc |
+++ b/ui/views/controls/textfield/textfield.cc |
@@ -1916,12 +1916,17 @@ void Textfield::UpdateContextMenu() { |
context_menu_contents_->AddSeparator(ui::NORMAL_SEPARATOR); |
context_menu_contents_->AddItemWithStringId(IDS_APP_SELECT_ALL, |
IDS_APP_SELECT_ALL); |
+ if (!text_context_menu_.get()) { |
tapted
2016/07/22 03:06:42
this `if` check shouldn't be needed..
spqchan
2016/12/12 19:32:27
Done.
|
+ text_context_menu_.reset(ViewsTextContextMenu::Create(this)); |
+ text_context_menu_->UpdateContextMenu(context_menu_contents_.get()); |
tapted
2016/07/22 03:06:42
but there should be a check before this to ensure
spqchan
2016/12/12 19:32:27
Removed text_context_menu_
|
+ } |
// If the controller adds menu commands, also override ExecuteCommand() and |
// IsCommandIdEnabled() as appropriate, for the commands added. |
if (controller_) |
controller_->UpdateContextMenu(context_menu_contents_.get()); |
} |
+ |
context_menu_runner_.reset( |
new MenuRunner(context_menu_contents_.get(), |
MenuRunner::HAS_MNEMONICS | MenuRunner::CONTEXT_MENU)); |