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: | |
Finnur
2011/01/11 21:27:26
This would take care of the NOTREACHED, but I'm no
| |
902 case WM_CHAR: | 903 case WM_CHAR: |
903 type = Event::ET_KEY_PRESSED; | 904 type = Event::ET_KEY_PRESSED; |
904 break; | 905 break; |
905 case WM_KEYUP: | 906 case WM_KEYUP: |
Finnur
2011/01/11 21:28:54
Will you not get WM_SYSKEYUP also?
| |
906 type = Event::ET_KEY_RELEASED; | 907 type = Event::ET_KEY_RELEASED; |
907 break; | 908 break; |
908 default: | 909 default: |
909 NOTREACHED() << "Unknown message:" << message; | 910 NOTREACHED() << "Unknown message:" << message; |
910 // Passing through to avoid crash on release build. | 911 // Passing through to avoid crash on release build. |
911 type = Event::ET_KEY_PRESSED; | 912 type = Event::ET_KEY_PRESSED; |
912 } | 913 } |
913 KeyEvent key_event(type, | 914 KeyEvent key_event(type, |
914 app::KeyboardCodeForWindowsKeyCode(key), | 915 app::KeyboardCodeForWindowsKeyCode(key), |
915 KeyEvent::GetKeyStateFlags(), | 916 KeyEvent::GetKeyStateFlags(), |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1111 //////////////////////////////////////////////////////////////////////////////// | 1112 //////////////////////////////////////////////////////////////////////////////// |
1112 // NativeTextfieldWrapper, public: | 1113 // NativeTextfieldWrapper, public: |
1113 | 1114 |
1114 // static | 1115 // static |
1115 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( | 1116 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( |
1116 Textfield* field) { | 1117 Textfield* field) { |
1117 return new NativeTextfieldWin(field); | 1118 return new NativeTextfieldWin(field); |
1118 } | 1119 } |
1119 | 1120 |
1120 } // namespace views | 1121 } // namespace views |
OLD | NEW |