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

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

Issue 7027014: Remove unused multiline attribute in textfield (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update for merge Created 9 years, 7 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 | « views/controls/textfield/native_textfield_views.cc ('k') | views/controls/textfield/textfield.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/textfield/native_textfield_win.cc
diff --git a/views/controls/textfield/native_textfield_win.cc b/views/controls/textfield/native_textfield_win.cc
index d7d27e75085c1f022bf240ac06ed5a23fee83268..df352b7ef07506d617597879977f0b6378d9f4f7 100644
--- a/views/controls/textfield/native_textfield_win.cc
+++ b/views/controls/textfield/native_textfield_win.cc
@@ -99,17 +99,13 @@ NativeTextfieldWin::NativeTextfieldWin(Textfield* textfield)
if (!did_load_library_)
did_load_library_ = !!LoadLibrary(L"riched20.dll");
- DWORD style = kDefaultEditStyle;
+ DWORD style = kDefaultEditStyle | ES_AUTOHSCROLL;
if (textfield_->style() & Textfield::STYLE_PASSWORD)
style |= ES_PASSWORD;
if (textfield_->read_only())
style |= ES_READONLY;
- if (textfield_->style() & Textfield::STYLE_MULTILINE)
- style |= ES_MULTILINE | ES_WANTRETURN | ES_AUTOVSCROLL;
- else
- style |= ES_AUTOHSCROLL;
// Make sure we apply RTL related extended window styles if necessary.
DWORD ex_style = l10n_util::GetExtendedStyles();
@@ -634,13 +630,11 @@ void NativeTextfieldWin::OnKeyDown(TCHAR key, UINT repeat_count, UINT flags) {
// in this function even with a WM_SYSKEYDOWN handler.
switch (key) {
+
+ // Ignore Return
case VK_RETURN:
- // If we are multi-line, we want to let returns through so they start a
- // new line.
- if (textfield_->IsMultiLine())
- break;
- else
- return;
+ return;
+
// Hijacking Editing Commands
//
// We hijack the keyboard short-cuts for Cut, Copy, and Paste here so that
« no previous file with comments | « views/controls/textfield/native_textfield_views.cc ('k') | views/controls/textfield/textfield.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698