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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 insert_(true), | 68 insert_(true), |
69 is_cursor_visible_(false), | 69 is_cursor_visible_(false), |
70 skip_input_method_cancel_composition_(false), | 70 skip_input_method_cancel_composition_(false), |
71 initiating_drag_(false), | 71 initiating_drag_(false), |
72 ALLOW_THIS_IN_INITIALIZER_LIST(cursor_timer_(this)), | 72 ALLOW_THIS_IN_INITIALIZER_LIST(cursor_timer_(this)), |
73 aggregated_clicks_(0), | 73 aggregated_clicks_(0), |
74 last_click_time_(base::Time::FromInternalValue(0)), | 74 last_click_time_(base::Time::FromInternalValue(0)), |
75 last_click_location_(0, 0) { | 75 last_click_location_(0, 0) { |
76 set_border(text_border_); | 76 set_border(text_border_); |
77 | 77 |
78 // Multiline is not supported. | |
79 DCHECK_NE(parent->style(), Textfield::STYLE_MULTILINE); | |
80 // Lowercase is not supported. | 78 // Lowercase is not supported. |
81 DCHECK_NE(parent->style(), Textfield::STYLE_LOWERCASE); | 79 DCHECK_NE(parent->style(), Textfield::STYLE_LOWERCASE); |
82 | 80 |
83 SetContextMenuController(this); | 81 SetContextMenuController(this); |
84 SetDragController(this); | 82 SetDragController(this); |
85 } | 83 } |
86 | 84 |
87 NativeTextfieldViews::~NativeTextfieldViews() { | 85 NativeTextfieldViews::~NativeTextfieldViews() { |
88 } | 86 } |
89 | 87 |
(...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1090 // Filter out all control characters, including tab and new line characters, | 1088 // Filter out all control characters, including tab and new line characters, |
1091 // and all characters with Alt modifier. But we need to allow characters with | 1089 // and all characters with Alt modifier. But we need to allow characters with |
1092 // AltGr modifier. | 1090 // AltGr modifier. |
1093 // On Windows AltGr is represented by Alt+Ctrl, and on Linux it's a different | 1091 // On Windows AltGr is represented by Alt+Ctrl, and on Linux it's a different |
1094 // flag that we don't care about. | 1092 // flag that we don't care about. |
1095 return ((ch >= 0x20 && ch < 0x7F) || ch > 0x9F) && | 1093 return ((ch >= 0x20 && ch < 0x7F) || ch > 0x9F) && |
1096 (flags & ~(ui::EF_SHIFT_DOWN | ui::EF_CAPS_LOCK_DOWN)) != ui::EF_ALT_DOWN; | 1094 (flags & ~(ui::EF_SHIFT_DOWN | ui::EF_CAPS_LOCK_DOWN)) != ui::EF_ALT_DOWN; |
1097 } | 1095 } |
1098 | 1096 |
1099 } // namespace views | 1097 } // namespace views |
OLD | NEW |