Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1101)

Side by Side Diff: ui/events/win/events_win.cc

Issue 551863003: Fix a crash which occurs while translating the windows message WM_DEADCHAR to our events format. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <windowsx.h> 5 #include <windowsx.h>
6 6
7 #include "ui/events/event_constants.h" 7 #include "ui/events/event_constants.h"
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 void UpdateDeviceList() { 144 void UpdateDeviceList() {
145 NOTIMPLEMENTED(); 145 NOTIMPLEMENTED();
146 } 146 }
147 147
148 EventType EventTypeFromNative(const base::NativeEvent& native_event) { 148 EventType EventTypeFromNative(const base::NativeEvent& native_event) {
149 switch (native_event.message) { 149 switch (native_event.message) {
150 case WM_KEYDOWN: 150 case WM_KEYDOWN:
151 case WM_SYSKEYDOWN: 151 case WM_SYSKEYDOWN:
152 case WM_CHAR: 152 case WM_CHAR:
153 return ET_KEY_PRESSED; 153 return ET_KEY_PRESSED;
154 // The WM_DEADCHAR message is posted to the window with the keyboard focus
155 // when a WM_KEYUP message is translated. This happens for special keyboard
156 // sequences.
157 case WM_DEADCHAR:
154 case WM_KEYUP: 158 case WM_KEYUP:
155 case WM_SYSKEYUP: 159 case WM_SYSKEYUP:
156 return ET_KEY_RELEASED; 160 return ET_KEY_RELEASED;
157 case WM_LBUTTONDBLCLK: 161 case WM_LBUTTONDBLCLK:
158 case WM_LBUTTONDOWN: 162 case WM_LBUTTONDOWN:
159 case WM_MBUTTONDBLCLK: 163 case WM_MBUTTONDBLCLK:
160 case WM_MBUTTONDOWN: 164 case WM_MBUTTONDOWN:
161 case WM_NCLBUTTONDBLCLK: 165 case WM_NCLBUTTONDBLCLK:
162 case WM_NCLBUTTONDOWN: 166 case WM_NCLBUTTONDOWN:
163 case WM_NCMBUTTONDBLCLK: 167 case WM_NCMBUTTONDBLCLK:
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 } 405 }
402 406
403 LPARAM GetLParamFromScanCode(uint16 scan_code) { 407 LPARAM GetLParamFromScanCode(uint16 scan_code) {
404 LPARAM l_param = static_cast<LPARAM>(scan_code & 0x00FF) << 16; 408 LPARAM l_param = static_cast<LPARAM>(scan_code & 0x00FF) << 16;
405 if ((scan_code & 0xE000) == 0xE000) 409 if ((scan_code & 0xE000) == 0xE000)
406 l_param |= (1 << 24); 410 l_param |= (1 << 24);
407 return l_param; 411 return l_param;
408 } 412 }
409 413
410 } // namespace ui 414 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698