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 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 if (is_cursor_visible_) { | 452 if (is_cursor_visible_) { |
453 is_cursor_visible_ = false; | 453 is_cursor_visible_ = false; |
454 RepaintCursor(); | 454 RepaintCursor(); |
455 } | 455 } |
456 } | 456 } |
457 | 457 |
458 TextInputClient* NativeTextfieldViews::GetTextInputClient() { | 458 TextInputClient* NativeTextfieldViews::GetTextInputClient() { |
459 return textfield_->read_only() ? NULL : this; | 459 return textfield_->read_only() ? NULL : this; |
460 } | 460 } |
461 | 461 |
| 462 void NativeTextfieldViews::ClearEditHistory() { |
| 463 model_->ClearEditHistory(); |
| 464 } |
| 465 |
462 ///////////////////////////////////////////////////////////////// | 466 ///////////////////////////////////////////////////////////////// |
463 // NativeTextfieldViews, ui::SimpleMenuModel::Delegate overrides: | 467 // NativeTextfieldViews, ui::SimpleMenuModel::Delegate overrides: |
464 | 468 |
465 bool NativeTextfieldViews::IsCommandIdChecked(int command_id) const { | 469 bool NativeTextfieldViews::IsCommandIdChecked(int command_id) const { |
466 return true; | 470 return true; |
467 } | 471 } |
468 | 472 |
469 bool NativeTextfieldViews::IsCommandIdEnabled(int command_id) const { | 473 bool NativeTextfieldViews::IsCommandIdEnabled(int command_id) const { |
470 bool editable = !textfield_->read_only(); | 474 bool editable = !textfield_->read_only(); |
471 string16 result; | 475 string16 result; |
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1086 // Filter out all control characters, including tab and new line characters, | 1090 // Filter out all control characters, including tab and new line characters, |
1087 // and all characters with Alt modifier. But we need to allow characters with | 1091 // and all characters with Alt modifier. But we need to allow characters with |
1088 // AltGr modifier. | 1092 // AltGr modifier. |
1089 // On Windows AltGr is represented by Alt+Ctrl, and on Linux it's a different | 1093 // On Windows AltGr is represented by Alt+Ctrl, and on Linux it's a different |
1090 // flag that we don't care about. | 1094 // flag that we don't care about. |
1091 return ((ch >= 0x20 && ch < 0x7F) || ch > 0x9F) && | 1095 return ((ch >= 0x20 && ch < 0x7F) || ch > 0x9F) && |
1092 (flags & ~(ui::EF_SHIFT_DOWN | ui::EF_CAPS_LOCK_DOWN)) != ui::EF_ALT_DOWN; | 1096 (flags & ~(ui::EF_SHIFT_DOWN | ui::EF_CAPS_LOCK_DOWN)) != ui::EF_ALT_DOWN; |
1093 } | 1097 } |
1094 | 1098 |
1095 } // namespace views | 1099 } // namespace views |
OLD | NEW |