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

Side by Side Diff: webkit/api/src/gtk/WebInputEventFactory.cpp

Issue 151010: A quick fix for Issue 15531 and 10953... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « webkit/api/public/gtk/WebInputEventFactory.h ('k') | 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 /* 1 /*
2 * Copyright (C) 2006-2009 Google Inc. All rights reserved. 2 * Copyright (C) 2006-2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 static_cast<WebUChar>(gdk_keyval_to_unicode(event->keyval)); 207 static_cast<WebUChar>(gdk_keyval_to_unicode(event->keyval));
208 } 208 }
209 209
210 result.setKeyIdentifierFromWindowsKeyCode(); 210 result.setKeyIdentifierFromWindowsKeyCode();
211 211
212 // FIXME: Do we need to set IsAutoRepeat or IsKeyPad? 212 // FIXME: Do we need to set IsAutoRepeat or IsKeyPad?
213 213
214 return result; 214 return result;
215 } 215 }
216 216
217 WebKeyboardEvent WebInputEventFactory::keyboardEvent(wchar_t character, double timeStampSeconds) 217 WebKeyboardEvent WebInputEventFactory::keyboardEvent(wchar_t character, int state, double timeStampSeconds)
218 { 218 {
219 // keyboardEvent(const GdkEventKey*) depends on the GdkEventKey object and 219 // keyboardEvent(const GdkEventKey*) depends on the GdkEventKey object and
220 // it is hard to use/ it from signal handlers which don't use GdkEventKey 220 // it is hard to use/ it from signal handlers which don't use GdkEventKey
221 // objects (e.g. GtkIMContext signal handlers.) For such handlers, this 221 // objects (e.g. GtkIMContext signal handlers.) For such handlers, this
222 // function creates a WebInputEvent::Char event without using a 222 // function creates a WebInputEvent::Char event without using a
223 // GdkEventKey object. 223 // GdkEventKey object.
224 WebKeyboardEvent result; 224 WebKeyboardEvent result;
225 result.type = WebKit::WebInputEvent::Char; 225 result.type = WebKit::WebInputEvent::Char;
226 result.timeStampSeconds = timeStampSeconds; 226 result.timeStampSeconds = timeStampSeconds;
227 result.modifiers = gdkStateToWebEventModifiers(state);
227 result.windowsKeyCode = character; 228 result.windowsKeyCode = character;
228 result.nativeKeyCode = character; 229 result.nativeKeyCode = character;
229 result.text[0] = character; 230 result.text[0] = character;
230 result.unmodifiedText[0] = character; 231 result.unmodifiedText[0] = character;
231 return result; 232 return result;
232 } 233 }
233 234
234 // WebMouseEvent -------------------------------------------------------------- 235 // WebMouseEvent --------------------------------------------------------------
235 236
236 WebMouseEvent WebInputEventFactory::mouseEvent(const GdkEventButton* event) 237 WebMouseEvent WebInputEventFactory::mouseEvent(const GdkEventButton* event)
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 case GDK_SCROLL_RIGHT: 357 case GDK_SCROLL_RIGHT:
357 result.deltaX = -scrollbarPixelsPerTick; 358 result.deltaX = -scrollbarPixelsPerTick;
358 result.wheelTicksX = 1; 359 result.wheelTicksX = 1;
359 break; 360 break;
360 } 361 }
361 362
362 return result; 363 return result;
363 } 364 }
364 365
365 } // namespace WebKit 366 } // namespace WebKit
OLDNEW
« no previous file with comments | « webkit/api/public/gtk/WebInputEventFactory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698