OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/views/controls/textfield/native_textfield_views.h" | 5 #include "ui/views/controls/textfield/native_textfield_views.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/command_line.h" | |
12 #include "base/debug/trace_event.h" | 11 #include "base/debug/trace_event.h" |
13 #include "base/i18n/case_conversion.h" | 12 #include "base/i18n/case_conversion.h" |
14 #include "base/logging.h" | 13 #include "base/logging.h" |
15 #include "base/message_loop.h" | 14 #include "base/message_loop.h" |
16 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
17 #include "grit/app_locale_settings.h" | 16 #include "grit/app_locale_settings.h" |
18 #include "grit/ui_strings.h" | 17 #include "grit/ui_strings.h" |
19 #include "third_party/skia/include/core/SkColor.h" | 18 #include "third_party/skia/include/core/SkColor.h" |
20 #include "ui/base/clipboard/clipboard.h" | 19 #include "ui/base/clipboard/clipboard.h" |
21 #include "ui/base/dragdrop/drag_drop_types.h" | 20 #include "ui/base/dragdrop/drag_drop_types.h" |
(...skipping 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1173 bool NativeTextfieldViews::ShouldInsertChar(char16 ch, int flags) { | 1172 bool NativeTextfieldViews::ShouldInsertChar(char16 ch, int flags) { |
1174 // Filter out all control characters, including tab and new line characters, | 1173 // Filter out all control characters, including tab and new line characters, |
1175 // and all characters with Alt modifier. But we need to allow characters with | 1174 // and all characters with Alt modifier. But we need to allow characters with |
1176 // AltGr modifier. | 1175 // AltGr modifier. |
1177 // On Windows AltGr is represented by Alt+Ctrl, and on Linux it's a different | 1176 // On Windows AltGr is represented by Alt+Ctrl, and on Linux it's a different |
1178 // flag that we don't care about. | 1177 // flag that we don't care about. |
1179 return ((ch >= 0x20 && ch < 0x7F) || ch > 0x9F) && | 1178 return ((ch >= 0x20 && ch < 0x7F) || ch > 0x9F) && |
1180 (flags & ~(ui::EF_SHIFT_DOWN | ui::EF_CAPS_LOCK_DOWN)) != ui::EF_ALT_DOWN; | 1179 (flags & ~(ui::EF_SHIFT_DOWN | ui::EF_CAPS_LOCK_DOWN)) != ui::EF_ALT_DOWN; |
1181 } | 1180 } |
1182 | 1181 |
1183 #if defined(USE_AURA) | |
1184 // static | |
1185 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( | |
1186 Textfield* field) { | |
1187 return new NativeTextfieldViews(field); | |
1188 } | |
1189 #endif | |
1190 | |
1191 } // namespace views | 1182 } // namespace views |
OLD | NEW |