OLD | NEW |
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 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1119 } | 1119 } |
1120 } | 1120 } |
1121 } else { | 1121 } else { |
1122 m_suppressNextKeypressEvent = true; | 1122 m_suppressNextKeypressEvent = true; |
1123 } | 1123 } |
1124 } | 1124 } |
1125 return result; | 1125 return result; |
1126 } | 1126 } |
1127 | 1127 |
1128 #if !OS(MACOSX) | 1128 #if !OS(MACOSX) |
1129 const WebInputEvent::Type contextMenuTriggeringEventType = | 1129 const WebInputEvent::Type contextMenuKeyTriggeringEventType = |
1130 #if OS(WIN) | 1130 #if OS(WIN) |
1131 WebInputEvent::KeyUp; | 1131 WebInputEvent::KeyUp; |
1132 #else | 1132 #else |
1133 WebInputEvent::RawKeyDown; | 1133 WebInputEvent::RawKeyDown; |
1134 #endif | 1134 #endif |
| 1135 const WebInputEvent::Type shiftF10TriggeringEventType = WebInputEvent::RawKe
yDown; |
1135 | 1136 |
1136 bool isUnmodifiedMenuKey = !(event.modifiers & WebInputEvent::InputModifiers
) && event.windowsKeyCode == VKEY_APPS; | 1137 bool isUnmodifiedMenuKey = !(event.modifiers & WebInputEvent::InputModifiers
) && event.windowsKeyCode == VKEY_APPS; |
1137 bool isShiftF10 = (event.modifiers & WebInputEvent::InputModifiers) == WebIn
putEvent::ShiftKey && event.windowsKeyCode == VKEY_F10; | 1138 bool isShiftF10 = (event.modifiers & WebInputEvent::InputModifiers) == WebIn
putEvent::ShiftKey && event.windowsKeyCode == VKEY_F10; |
1138 if ((isUnmodifiedMenuKey || isShiftF10) && event.type == contextMenuTriggeri
ngEventType) { | 1139 if ((isUnmodifiedMenuKey && event.type == contextMenuKeyTriggeringEventType) |
| 1140 || (isShiftF10 && event.type == shiftF10TriggeringEventType)) { |
1139 sendContextMenuEvent(event); | 1141 sendContextMenuEvent(event); |
1140 return WebInputEventResult::HandledSystem; | 1142 return WebInputEventResult::HandledSystem; |
1141 } | 1143 } |
1142 #endif // !OS(MACOSX) | 1144 #endif // !OS(MACOSX) |
1143 | 1145 |
1144 if (keyEventDefault(event)) | 1146 if (keyEventDefault(event)) |
1145 return WebInputEventResult::HandledSystem; | 1147 return WebInputEventResult::HandledSystem; |
1146 return WebInputEventResult::NotHandled; | 1148 return WebInputEventResult::NotHandled; |
1147 } | 1149 } |
1148 | 1150 |
(...skipping 3465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4614 return nullptr; | 4616 return nullptr; |
4615 return focusedFrame; | 4617 return focusedFrame; |
4616 } | 4618 } |
4617 | 4619 |
4618 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const | 4620 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const |
4619 { | 4621 { |
4620 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; | 4622 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; |
4621 } | 4623 } |
4622 | 4624 |
4623 } // namespace blink | 4625 } // namespace blink |
OLD | NEW |