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

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

Issue 2688883002: Revert [MacViews] Implemented text context menu (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « ui/views/controls/textfield/textfield.h ('k') | ui/views/controls/textfield/textfield_test_api.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/textfield/textfield.cc
diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc
index 15df149a4605087f0d292bb23724738a7b3009a5..1f4a7f63bc1d107b5229858a8ff76f843f06aac1 100644
--- a/ui/views/controls/textfield/textfield.cc
+++ b/ui/views/controls/textfield/textfield.cc
@@ -42,7 +42,6 @@
#include "ui/views/controls/menu/menu_runner.h"
#include "ui/views/controls/native/native_view_host.h"
#include "ui/views/controls/textfield/textfield_controller.h"
-#include "ui/views/controls/views_text_services_context_menu.h"
#include "ui/views/drag_utils.h"
#include "ui/views/native_cursor.h"
#include "ui/views/painter.h"
@@ -1089,19 +1088,11 @@ bool Textfield::CanStartDragForView(View* sender,
////////////////////////////////////////////////////////////////////////////////
// Textfield, WordLookupClient overrides:
-bool Textfield::GetDecoratedWordAndBaselineAtPoint(
- const gfx::Point& point,
- gfx::DecoratedText* decorated_word,
- gfx::Point* baseline_point) {
- return GetRenderText()->GetDecoratedWordAndBaselineAtPoint(
- point, decorated_word, baseline_point);
-}
-
-bool Textfield::GetDecoratedTextAndBaselineFromSelection(
- gfx::DecoratedText* decorated_text,
- gfx::Point* baseline_point) {
- return GetRenderText()->GetDecoratedTextAndBaselineForRange(
- GetRenderText()->selection(), decorated_text, baseline_point);
+bool Textfield::GetDecoratedWordAtPoint(const gfx::Point& point,
+ gfx::DecoratedText* decorated_word,
+ gfx::Point* baseline_point) {
+ return GetRenderText()->GetDecoratedWordAtPoint(point, decorated_word,
+ baseline_point);
}
////////////////////////////////////////////////////////////////////////////////
@@ -1198,20 +1189,10 @@ void Textfield::DestroyTouchSelection() {
// Textfield, ui::SimpleMenuModel::Delegate overrides:
bool Textfield::IsCommandIdChecked(int command_id) const {
- if (text_services_context_menu_ &&
- text_services_context_menu_->HandlesCommandId(command_id)) {
- return text_services_context_menu_->IsCommandIdChecked(command_id);
- }
-
return true;
}
bool Textfield::IsCommandIdEnabled(int command_id) const {
- if (text_services_context_menu_ &&
- text_services_context_menu_->HandlesCommandId(command_id)) {
- return text_services_context_menu_->IsCommandIdEnabled(command_id);
- }
-
return Textfield::IsTextEditCommandEnabled(
GetTextEditCommandFromMenuCommand(command_id, HasSelection()));
}
@@ -1245,12 +1226,6 @@ bool Textfield::GetAcceleratorForCommandId(int command_id,
}
void Textfield::ExecuteCommand(int command_id, int event_flags) {
- if (text_services_context_menu_ &&
- text_services_context_menu_->HandlesCommandId(command_id)) {
- text_services_context_menu_->ExecuteCommand(command_id, event_flags);
- return;
- }
-
Textfield::ExecuteTextEditCommand(
GetTextEditCommandFromMenuCommand(command_id, HasSelection()));
}
@@ -1965,11 +1940,6 @@ void Textfield::OnCaretBoundsChanged() {
GetInputMethod()->OnCaretBoundsChanged(this);
if (touch_selection_controller_)
touch_selection_controller_->SelectionChanged();
-
- // On Mac, the context menu contains a look up item which displays the
- // selected text. As such, the menu needs to be updated if the selection has
- // changed.
- context_menu_contents_.reset();
}
void Textfield::OnBeforeUserAction() {
@@ -2031,11 +2001,7 @@ void Textfield::UpdateContextMenu() {
// IsCommandIdEnabled() as appropriate, for the commands added.
if (controller_)
controller_->UpdateContextMenu(context_menu_contents_.get());
-
- text_services_context_menu_ = ViewsTextServicesContextMenu::Create(
- context_menu_contents_.get(), this);
}
-
context_menu_runner_.reset(new MenuRunner(context_menu_contents_.get(),
MenuRunner::HAS_MNEMONICS |
MenuRunner::CONTEXT_MENU |
« no previous file with comments | « ui/views/controls/textfield/textfield.h ('k') | ui/views/controls/textfield/textfield_test_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698