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

Side by Side Diff: webkit/api/src/WebInputEventConversion.cpp

Issue 269084: Allow keyboard input to work in Mac plugins.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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 | « no previous file | webkit/api/src/WebPluginContainerImpl.cpp » ('j') | 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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 windowY = p.y(); 230 windowY = p.y();
231 x = event.offsetX(); 231 x = event.offsetX();
232 y = event.offsetY(); 232 y = event.offsetY();
233 } 233 }
234 234
235 WebKeyboardEventBuilder::WebKeyboardEventBuilder(const KeyboardEvent& event) { 235 WebKeyboardEventBuilder::WebKeyboardEventBuilder(const KeyboardEvent& event) {
236 if (event.type() == eventNames().keydownEvent) 236 if (event.type() == eventNames().keydownEvent)
237 type = KeyDown; 237 type = KeyDown;
238 else if (event.type() == eventNames().keyupEvent) 238 else if (event.type() == eventNames().keyupEvent)
239 type = WebInputEvent::KeyUp; 239 type = WebInputEvent::KeyUp;
240 else if (event.type() == eventNames().keypressEvent)
241 type = WebInputEvent::Char;
240 else 242 else
241 return; // Skip all other keyboard events. 243 return; // Skip all other keyboard events.
242 modifiers = getWebInputModifiers(event); 244 modifiers = getWebInputModifiers(event);
243 timeStampSeconds = event.timeStamp() * 1.0e-3; 245 timeStampSeconds = event.timeStamp() * 1.0e-3;
244 windowsKeyCode = event.keyCode(); 246 windowsKeyCode = event.keyCode();
245 nativeKeyCode = event.keyEvent()->nativeVirtualKeyCode(); 247 nativeKeyCode = event.keyEvent()->nativeVirtualKeyCode();
248 unsigned int numChars = std::min(event.keyEvent()->text().length(),
249 static_cast<unsigned int>(WebKeyboardEvent::textLengthCap));
250 for (unsigned int i = 0; i < numChars; i++) {
251 text[i] = event.keyEvent()->text()[i];
252 unmodifiedText[i] = event.keyEvent()->unmodifiedText()[i];
253 }
246 } 254 }
247 255
248 } // namespace WebKit 256 } // namespace WebKit
OLDNEW
« no previous file with comments | « no previous file | webkit/api/src/WebPluginContainerImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698