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

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

Issue 2348143003: MacViews: Implement Force Touch/Mac dictionary lookup for Textfields. (Closed)
Patch Set: Views export, reduntant forward decl. 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.cc
diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc
index 4642d23fc89a89633cc84ff72fbb5011959a7b9d..418cf04794ac9beb393eaec386c5adcc215cbfc7 100644
--- a/ui/views/controls/textfield/textfield.cc
+++ b/ui/views/controls/textfield/textfield.cc
@@ -649,6 +649,10 @@ void Textfield::OnMouseReleased(const ui::MouseEvent& event) {
OnAfterUserAction();
}
+LookupWordClient* Textfield::GetLookupWordClient() {
+ return this;
+}
+
bool Textfield::OnKeyPressed(const ui::KeyEvent& event) {
ui::TextEditCommand edit_command = scheduled_text_edit_command_;
scheduled_text_edit_command_ = ui::TextEditCommand::INVALID_COMMAND;
@@ -1097,6 +1101,16 @@ bool Textfield::CanStartDragForView(View* sender,
}
////////////////////////////////////////////////////////////////////////////////
+// Textfield, LookupWordClient overrides:
+
+bool Textfield::GetDecoratedWordAtPoint(const gfx::Point& point,
+ gfx::DecoratedText* decorated_word,
+ gfx::Point* baseline_point) {
+ return GetRenderText()->GetDecoratedWordAtPoint(point, decorated_word,
+ baseline_point);
+}
+
+////////////////////////////////////////////////////////////////////////////////
// Textfield, ui::TouchEditable overrides:
void Textfield::SelectRect(const gfx::Point& start, const gfx::Point& end) {

Powered by Google App Engine
This is Rietveld 408576698