| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/views/text_field.h" | 5 #include "chrome/views/text_field.h" |
| 6 | 6 |
| 7 #include <atlbase.h> | 7 #include <atlbase.h> |
| 8 #include <atlapp.h> | 8 #include <atlapp.h> |
| 9 #include <atlcrack.h> | 9 #include <atlcrack.h> |
| 10 #include <atlctrls.h> | 10 #include <atlctrls.h> |
| 11 #include <tom.h> // For ITextDocument, a COM interface to CRichEditCtrl | 11 #include <tom.h> // For ITextDocument, a COM interface to CRichEditCtrl |
| 12 #include <vsstyle.h> | 12 #include <vsstyle.h> |
| 13 | 13 |
| 14 #include "base/gfx/native_theme.h" | 14 #include "base/gfx/native_theme.h" |
| 15 #include "base/gfx/skia_utils.h" | |
| 16 #include "base/scoped_clipboard_writer.h" | 15 #include "base/scoped_clipboard_writer.h" |
| 17 #include "base/string_util.h" | 16 #include "base/string_util.h" |
| 18 #include "base/win_util.h" | 17 #include "base/win_util.h" |
| 19 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
| 20 #include "chrome/common/clipboard_service.h" | 19 #include "chrome/common/clipboard_service.h" |
| 21 #include "chrome/common/gfx/insets.h" | 20 #include "chrome/common/gfx/insets.h" |
| 22 #include "chrome/common/l10n_util.h" | 21 #include "chrome/common/l10n_util.h" |
| 23 #include "chrome/common/logging_chrome.h" | 22 #include "chrome/common/logging_chrome.h" |
| 24 #include "chrome/common/win_util.h" | 23 #include "chrome/common/win_util.h" |
| 25 #include "chrome/views/hwnd_view.h" | 24 #include "chrome/views/hwnd_view.h" |
| 26 #include "chrome/views/menu.h" | 25 #include "chrome/views/menu.h" |
| 27 #include "chrome/views/widget.h" | 26 #include "chrome/views/widget.h" |
| 28 | |
| 29 #include "generated_resources.h" | 27 #include "generated_resources.h" |
| 28 #include "skia/ext/skia_utils_win.h" |
| 30 | 29 |
| 31 using gfx::NativeTheme; | 30 using gfx::NativeTheme; |
| 32 | 31 |
| 33 namespace views { | 32 namespace views { |
| 34 | 33 |
| 35 static const int kDefaultEditStyle = WS_CHILD | WS_VISIBLE; | 34 static const int kDefaultEditStyle = WS_CHILD | WS_VISIBLE; |
| 36 | 35 |
| 37 class TextField::Edit | 36 class TextField::Edit |
| 38 : public CWindowImpl<TextField::Edit, CRichEditCtrl, | 37 : public CWindowImpl<TextField::Edit, CRichEditCtrl, |
| 39 CWinTraits<kDefaultEditStyle> >, | 38 CWinTraits<kDefaultEditStyle> >, |
| (...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1080 | 1079 |
| 1081 return !win_util::IsNumPadDigit(e.GetCharacter(), e.IsExtendedKey()); | 1080 return !win_util::IsNumPadDigit(e.GetCharacter(), e.IsExtendedKey()); |
| 1082 } | 1081 } |
| 1083 | 1082 |
| 1084 void TextField::UpdateEditBackgroundColor() { | 1083 void TextField::UpdateEditBackgroundColor() { |
| 1085 if (!edit_) | 1084 if (!edit_) |
| 1086 return; | 1085 return; |
| 1087 | 1086 |
| 1088 COLORREF bg_color; | 1087 COLORREF bg_color; |
| 1089 if (!use_default_background_color_) | 1088 if (!use_default_background_color_) |
| 1090 bg_color = gfx::SkColorToCOLORREF(background_color_); | 1089 bg_color = skia::SkColorToCOLORREF(background_color_); |
| 1091 else | 1090 else |
| 1092 bg_color = GetSysColor(read_only_ ? COLOR_3DFACE : COLOR_WINDOW); | 1091 bg_color = GetSysColor(read_only_ ? COLOR_3DFACE : COLOR_WINDOW); |
| 1093 edit_->SetBackgroundColor(bg_color); | 1092 edit_->SetBackgroundColor(bg_color); |
| 1094 } | 1093 } |
| 1095 | 1094 |
| 1096 } // namespace views | 1095 } // namespace views |
| OLD | NEW |