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

Unified Diff: ui/views/cocoa/bridged_content_view.mm

Issue 2218773002: MacViews: Underline composition text. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address nit. Created 4 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/cocoa/bridged_content_view.mm
diff --git a/ui/views/cocoa/bridged_content_view.mm b/ui/views/cocoa/bridged_content_view.mm
index e1c7497c1814578fca72bac2b56749befc3982d3..fda66f2d0db6687179bb2071dd2171545f1dcad7 100644
--- a/ui/views/cocoa/bridged_content_view.mm
+++ b/ui/views/cocoa/bridged_content_view.mm
@@ -1237,6 +1237,16 @@ - (void)setMarkedText:(id)text
ui::CompositionText composition;
composition.text = base::SysNSStringToUTF16(text);
composition.selection = gfx::Range(selectedRange);
+
+ // Add a black underline with a transparent background to the composition
+ // text. TODO(karandeepb): On Cocoa textfields, the target clause of the
+ // composition has a thick underlines. The composition text also has
+ // discontinous underlines for different clauses. This is also supported in
+ // the Chrome renderer. Add code to extract underlines from |text| once our
+ // render text implementation supports thick underlines and discontinous
+ // underlines for consecutive characters. See http://crbug.com/612675.
+ composition.underlines.push_back(ui::CompositionUnderline(
+ 0, [text length], SK_ColorBLACK, false, SK_ColorTRANSPARENT));
textInputClient_->SetCompositionText(composition);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698