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

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

Issue 11535014: Replace StyleRange with BreakList; update RenderText, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments. Created 7 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
Index: ui/views/controls/textfield/native_textfield_views.cc
diff --git a/ui/views/controls/textfield/native_textfield_views.cc b/ui/views/controls/textfield/native_textfield_views.cc
index be33761ea6edb6c20c4b2ca06e6899aecc5a94b7..c8cfb993c18da65c38b5abf7e4f36e4c23cd200c 100644
--- a/ui/views/controls/textfield/native_textfield_views.cc
+++ b/ui/views/controls/textfield/native_textfield_views.cc
@@ -441,11 +441,7 @@ void NativeTextfieldViews::UpdateBorderColor() {
}
void NativeTextfieldViews::UpdateTextColor() {
- gfx::StyleRange default_style(GetRenderText()->default_style());
- default_style.foreground = textfield_->GetTextColor();
- GetRenderText()->set_default_style(default_style);
- GetRenderText()->ApplyDefaultStyle();
- SchedulePaint();
+ SetColor(textfield_->GetTextColor());
}
void NativeTextfieldViews::UpdateBackgroundColor() {
@@ -698,13 +694,25 @@ void NativeTextfieldViews::ExecuteCommand(int command_id) {
OnAfterUserAction();
}
-void NativeTextfieldViews::ApplyStyleRange(const gfx::StyleRange& style) {
- GetRenderText()->ApplyStyleRange(style);
+void NativeTextfieldViews::SetColor(SkColor value) {
+ GetRenderText()->SetColor(value);
+ SchedulePaint();
+}
+
+void NativeTextfieldViews::ApplyColor(SkColor value, const ui::Range& range) {
+ GetRenderText()->ApplyColor(value, range);
+ SchedulePaint();
+}
+
+void NativeTextfieldViews::SetStyle(gfx::TextStyle style, bool value) {
+ GetRenderText()->SetStyle(style, value);
SchedulePaint();
}
-void NativeTextfieldViews::ApplyDefaultStyle() {
- GetRenderText()->ApplyDefaultStyle();
+void NativeTextfieldViews::ApplyStyle(gfx::TextStyle style,
+ bool value,
+ const ui::Range& range) {
+ GetRenderText()->ApplyStyle(style, value, range);
SchedulePaint();
}
« no previous file with comments | « ui/views/controls/textfield/native_textfield_views.h ('k') | ui/views/controls/textfield/native_textfield_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698