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

Side by Side Diff: third_party/WebKit/Source/core/html/MediaDocument.cpp

Issue 2045603002: Handle the "key" field as opposed to keyIdentifier field. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove initialization of the view Created 4 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 Node* targetNode = event->target()->toNode(); 249 Node* targetNode = event->target()->toNode();
250 if (!targetNode) 250 if (!targetNode)
251 return; 251 return;
252 252
253 if (event->type() == EventTypeNames::keydown && event->isKeyboardEvent()) { 253 if (event->type() == EventTypeNames::keydown && event->isKeyboardEvent()) {
254 HTMLVideoElement* video = Traversal<HTMLVideoElement>::firstWithin(*targ etNode); 254 HTMLVideoElement* video = Traversal<HTMLVideoElement>::firstWithin(*targ etNode);
255 if (!video) 255 if (!video)
256 return; 256 return;
257 257
258 KeyboardEvent* keyboardEvent = toKeyboardEvent(event); 258 KeyboardEvent* keyboardEvent = toKeyboardEvent(event);
259 if (keyboardEvent->keyIdentifier() == "U+0020" || keyboardEvent->keyCode () == VKEY_MEDIA_PLAY_PAUSE) { 259 if (keyboardEvent->key() == " " || keyboardEvent->keyCode() == VKEY_MEDI A_PLAY_PAUSE) {
260 // space or media key (play/pause) 260 // space or media key (play/pause)
261 video->togglePlayState(); 261 video->togglePlayState();
262 event->setDefaultHandled(); 262 event->setDefaultHandled();
263 } 263 }
264 } 264 }
265 } 265 }
266 266
267 } // namespace blink 267 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698