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

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

Issue 11421204: Use native theme colors for textfields; etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nix cursor color; adjust textfield functions; add read-only theme colors. Created 8 years 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_win.cc
diff --git a/ui/views/controls/textfield/native_textfield_win.cc b/ui/views/controls/textfield/native_textfield_win.cc
index 916b19d38fb9598288d0ea627ff35e077edc3c51..f6f564a99410c49c2df5789e31868be650fbc24a 100644
--- a/ui/views/controls/textfield/native_textfield_win.cc
+++ b/ui/views/controls/textfield/native_textfield_win.cc
@@ -249,25 +249,13 @@ void NativeTextfieldWin::UpdateBorder() {
void NativeTextfieldWin::UpdateTextColor() {
CHARFORMAT cf = {0};
cf.dwMask = CFM_COLOR;
- cf.crTextColor = textfield_->use_default_text_color() ?
- GetSysColor(textfield_->read_only() ? COLOR_GRAYTEXT : COLOR_WINDOWTEXT) :
- skia::SkColorToCOLORREF(textfield_->text_color());
+ cf.crTextColor = skia::SkColorToCOLORREF(textfield_->GetTextColor());
CRichEditCtrl::SetDefaultCharFormat(cf);
}
void NativeTextfieldWin::UpdateBackgroundColor() {
- if (!textfield_->use_default_background_color()) {
- bg_color_ = skia::SkColorToCOLORREF(textfield_->background_color());
- } else {
- bg_color_ = GetSysColor(textfield_->read_only() ? COLOR_3DFACE
- : COLOR_WINDOW);
- }
- CRichEditCtrl::SetBackgroundColor(bg_color_);
-}
-
-void NativeTextfieldWin::UpdateCursorColor() {
- if (!textfield_->use_default_cursor_color())
- NOTIMPLEMENTED();
+ CRichEditCtrl::SetBackgroundColor(
+ skia::SkColorToCOLORREF(textfield_->GetBackgroundColor()));
}
void NativeTextfieldWin::UpdateReadOnly() {

Powered by Google App Engine
This is Rietveld 408576698