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

Side by Side Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2434463003: Add coalesced KeyDown handling for arrow key scrolling. (Closed)
Patch Set: Created 4 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
« no previous file with comments | « third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp ('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) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 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 1653 matching lines...) Expand 10 before | Expand all | Expand 10 after
1664 element.unwrap<Element>()); 1664 element.unwrap<Element>());
1665 } 1665 }
1666 } 1666 }
1667 1667
1668 bool WebViewImpl::keyEventDefault(const WebKeyboardEvent& event) { 1668 bool WebViewImpl::keyEventDefault(const WebKeyboardEvent& event) {
1669 LocalFrame* frame = toLocalFrame(focusedCoreFrame()); 1669 LocalFrame* frame = toLocalFrame(focusedCoreFrame());
1670 if (!frame) 1670 if (!frame)
1671 return false; 1671 return false;
1672 1672
1673 switch (event.type) { 1673 switch (event.type) {
1674 case WebInputEvent::Char: 1674 case WebInputEvent::Char:
aelias_OOO_until_Jul13 2016/10/19 17:55:09 Note that although Android does not send Char even
1675 if (event.windowsKeyCode == VKEY_SPACE) { 1675 if (event.windowsKeyCode == VKEY_SPACE) {
1676 int keyCode = ((event.modifiers & WebInputEvent::ShiftKey) ? VKEY_PRIOR 1676 int keyCode = ((event.modifiers & WebInputEvent::ShiftKey) ? VKEY_PRIOR
1677 : VKEY_NEXT); 1677 : VKEY_NEXT);
1678 return scrollViewWithKeyboard(keyCode, event.modifiers); 1678 return scrollViewWithKeyboard(keyCode, event.modifiers);
1679 } 1679 }
1680 break; 1680 break;
1681 case WebInputEvent::KeyDown:
1681 case WebInputEvent::RawKeyDown: 1682 case WebInputEvent::RawKeyDown:
1682 if (event.modifiers == WebInputEvent::ControlKey) { 1683 if (event.modifiers == WebInputEvent::ControlKey) {
1683 switch (event.windowsKeyCode) { 1684 switch (event.windowsKeyCode) {
1684 #if !OS(MACOSX) 1685 #if !OS(MACOSX)
1685 case 'A': 1686 case 'A':
1686 focusedFrame()->executeCommand(WebString::fromUTF8("SelectAll")); 1687 focusedFrame()->executeCommand(WebString::fromUTF8("SelectAll"));
1687 return true; 1688 return true;
1688 case VKEY_INSERT: 1689 case VKEY_INSERT:
1689 case 'C': 1690 case 'C':
1690 focusedFrame()->executeCommand(WebString::fromUTF8("Copy")); 1691 focusedFrame()->executeCommand(WebString::fromUTF8("Copy"));
(...skipping 3051 matching lines...) Expand 10 before | Expand all | Expand 10 after
4742 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) 4743 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame())
4743 return nullptr; 4744 return nullptr;
4744 return focusedFrame; 4745 return focusedFrame;
4745 } 4746 }
4746 4747
4747 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { 4748 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const {
4748 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; 4749 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr;
4749 } 4750 }
4750 4751
4751 } // namespace blink 4752 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698