| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_win.h" | 5 #include "views/controls/textfield/native_textfield_win.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "app/keyboard_codes.h" | 9 #include "app/keyboard_codes.h" |
| 10 #include "app/keyboard_code_conversion_win.h" | 10 #include "app/keyboard_code_conversion_win.h" |
| (...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 892 UINT repeat_count, | 892 UINT repeat_count, |
| 893 UINT flags) { | 893 UINT flags) { |
| 894 ScopedFreeze freeze(this, GetTextObjectModel()); | 894 ScopedFreeze freeze(this, GetTextObjectModel()); |
| 895 | 895 |
| 896 Textfield::Controller* controller = textfield_->GetController(); | 896 Textfield::Controller* controller = textfield_->GetController(); |
| 897 bool handled = false; | 897 bool handled = false; |
| 898 if (controller) { | 898 if (controller) { |
| 899 Event::EventType type; | 899 Event::EventType type; |
| 900 switch (message) { | 900 switch (message) { |
| 901 case WM_KEYDOWN: | 901 case WM_KEYDOWN: |
| 902 case WM_SYSKEYDOWN: |
| 902 case WM_CHAR: | 903 case WM_CHAR: |
| 904 case WM_SYSCHAR: |
| 903 type = Event::ET_KEY_PRESSED; | 905 type = Event::ET_KEY_PRESSED; |
| 904 break; | 906 break; |
| 905 case WM_KEYUP: | 907 case WM_KEYUP: |
| 908 case WM_SYSKEYUP: |
| 906 type = Event::ET_KEY_RELEASED; | 909 type = Event::ET_KEY_RELEASED; |
| 907 break; | 910 break; |
| 908 default: | 911 default: |
| 909 NOTREACHED() << "Unknown message:" << message; | 912 NOTREACHED() << "Unknown message:" << message; |
| 910 // Passing through to avoid crash on release build. | 913 // Passing through to avoid crash on release build. |
| 911 type = Event::ET_KEY_PRESSED; | 914 type = Event::ET_KEY_PRESSED; |
| 912 } | 915 } |
| 913 KeyEvent key_event(type, | 916 KeyEvent key_event(type, |
| 914 app::KeyboardCodeForWindowsKeyCode(key), | 917 app::KeyboardCodeForWindowsKeyCode(key), |
| 915 KeyEvent::GetKeyStateFlags(), | 918 KeyEvent::GetKeyStateFlags(), |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1111 //////////////////////////////////////////////////////////////////////////////// | 1114 //////////////////////////////////////////////////////////////////////////////// |
| 1112 // NativeTextfieldWrapper, public: | 1115 // NativeTextfieldWrapper, public: |
| 1113 | 1116 |
| 1114 // static | 1117 // static |
| 1115 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( | 1118 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( |
| 1116 Textfield* field) { | 1119 Textfield* field) { |
| 1117 return new NativeTextfieldWin(field); | 1120 return new NativeTextfieldWin(field); |
| 1118 } | 1121 } |
| 1119 | 1122 |
| 1120 } // namespace views | 1123 } // namespace views |
| OLD | NEW |