| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "views/controls/textfield/native_textfield_views.h" | 5 #include "views/controls/textfield/native_textfield_views.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 insert_(true), | 67 insert_(true), |
| 68 is_cursor_visible_(false), | 68 is_cursor_visible_(false), |
| 69 skip_input_method_cancel_composition_(false), | 69 skip_input_method_cancel_composition_(false), |
| 70 initiating_drag_(false), | 70 initiating_drag_(false), |
| 71 ALLOW_THIS_IN_INITIALIZER_LIST(cursor_timer_(this)), | 71 ALLOW_THIS_IN_INITIALIZER_LIST(cursor_timer_(this)), |
| 72 aggregated_clicks_(0), | 72 aggregated_clicks_(0), |
| 73 last_click_time_(base::Time::FromInternalValue(0)), | 73 last_click_time_(base::Time::FromInternalValue(0)), |
| 74 last_click_location_(0, 0) { | 74 last_click_location_(0, 0) { |
| 75 set_border(text_border_); | 75 set_border(text_border_); |
| 76 | 76 |
| 77 // Multiline is not supported. | |
| 78 DCHECK_NE(parent->style(), Textfield::STYLE_MULTILINE); | |
| 79 // Lowercase is not supported. | 77 // Lowercase is not supported. |
| 80 DCHECK_NE(parent->style(), Textfield::STYLE_LOWERCASE); | 78 DCHECK_NE(parent->style(), Textfield::STYLE_LOWERCASE); |
| 81 | 79 |
| 82 SetContextMenuController(this); | 80 SetContextMenuController(this); |
| 83 SetDragController(this); | 81 SetDragController(this); |
| 84 } | 82 } |
| 85 | 83 |
| 86 NativeTextfieldViews::~NativeTextfieldViews() { | 84 NativeTextfieldViews::~NativeTextfieldViews() { |
| 87 } | 85 } |
| 88 | 86 |
| (...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1074 // Filter out all control characters, including tab and new line characters, | 1072 // Filter out all control characters, including tab and new line characters, |
| 1075 // and all characters with Alt modifier. But we need to allow characters with | 1073 // and all characters with Alt modifier. But we need to allow characters with |
| 1076 // AltGr modifier. | 1074 // AltGr modifier. |
| 1077 // On Windows AltGr is represented by Alt+Ctrl, and on Linux it's a different | 1075 // On Windows AltGr is represented by Alt+Ctrl, and on Linux it's a different |
| 1078 // flag that we don't care about. | 1076 // flag that we don't care about. |
| 1079 return ((ch >= 0x20 && ch < 0x7F) || ch > 0x9F) && | 1077 return ((ch >= 0x20 && ch < 0x7F) || ch > 0x9F) && |
| 1080 (flags & ~(ui::EF_SHIFT_DOWN | ui::EF_CAPS_LOCK_DOWN)) != ui::EF_ALT_DOWN; | 1078 (flags & ~(ui::EF_SHIFT_DOWN | ui::EF_CAPS_LOCK_DOWN)) != ui::EF_ALT_DOWN; |
| 1081 } | 1079 } |
| 1082 | 1080 |
| 1083 } // namespace views | 1081 } // namespace views |
| OLD | NEW |