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

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

Issue 2164483006: [MacViews] Implemented text context menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ditto Created 4 years, 5 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.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));

Powered by Google App Engine
This is Rietveld 408576698