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

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

Issue 2639493002: MacViews: Enable word lookup for selectable views::Labels and multi-line text. (Closed)
Patch Set: Address nits. Created 3 years, 11 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/label.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/label.cc
diff --git a/ui/views/controls/label.cc b/ui/views/controls/label.cc
index 9b04c091ff1ab436580068f0d8a18cb0e9526562..a047acbd51c35cdec04f00955df331f2eda11563 100644
--- a/ui/views/controls/label.cc
+++ b/ui/views/controls/label.cc
@@ -395,6 +395,10 @@ bool Label::CanProcessEventsWithinSubtree() const {
return !!GetRenderTextForSelectionController();
}
+WordLookupClient* Label::GetWordLookupClient() {
+ return this;
+}
+
void Label::GetAccessibleNodeData(ui::AXNodeData* node_data) {
node_data->role = ui::AX_ROLE_STATIC_TEXT;
node_data->AddStateFlag(ui::AX_STATE_READ_ONLY);
@@ -633,6 +637,16 @@ void Label::ShowContextMenuForView(View* source,
source_type));
}
+bool Label::GetDecoratedWordAtPoint(const gfx::Point& point,
+ gfx::DecoratedText* decorated_word,
+ gfx::Point* baseline_point) {
+ gfx::RenderText* render_text = GetRenderTextForSelectionController();
+ return render_text
+ ? render_text->GetDecoratedWordAtPoint(point, decorated_word,
+ baseline_point)
+ : false;
+}
+
gfx::RenderText* Label::GetRenderTextForSelectionController() {
return const_cast<gfx::RenderText*>(
static_cast<const Label*>(this)->GetRenderTextForSelectionController());
« no previous file with comments | « ui/views/controls/label.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698