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 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
939 webFrame->client()->forwardInputEvent(&event); | 939 webFrame->client()->forwardInputEvent(&event); |
940 return true; | 940 return true; |
941 } | 941 } |
942 | 942 |
943 if (!focusedFrame || !focusedFrame->isLocalFrame()) | 943 if (!focusedFrame || !focusedFrame->isLocalFrame()) |
944 return false; | 944 return false; |
945 | 945 |
946 RefPtr<LocalFrame> frame = toLocalFrame(focusedFrame.get()); | 946 RefPtr<LocalFrame> frame = toLocalFrame(focusedFrame.get()); |
947 | 947 |
948 PlatformKeyboardEventBuilder evt(event); | 948 PlatformKeyboardEventBuilder evt(event); |
| 949 // Suppress the next keypress event unless the focused node is a |
| 950 // plug-in node. |
| 951 // (Flash needs these keypress events to handle non-US keyboards.) |
| 952 if (WebInputEvent::RawKeyDown == event.type) { |
| 953 Element* element = focusedElement(); |
| 954 if (!element || !element->renderer() |
| 955 || !element->renderer()->isEmbeddedObject()) |
| 956 m_suppressNextKeypressEvent = true; |
| 957 } |
949 | 958 |
950 if (frame->eventHandler().keyEvent(evt)) { | 959 if (frame->eventHandler().keyEvent(evt)) |
951 if (WebInputEvent::RawKeyDown == event.type) { | |
952 // Suppress the next keypress event unless the focused node is a plu
g-in node. | |
953 // (Flash needs these keypress events to handle non-US keyboards.) | |
954 Element* element = focusedElement(); | |
955 if (!element || !element->renderer() || !element->renderer()->isEmbe
ddedObject()) | |
956 m_suppressNextKeypressEvent = true; | |
957 } | |
958 return true; | 960 return true; |
959 } | 961 |
| 962 m_suppressNextKeypressEvent = false; |
960 | 963 |
961 #if !OS(MACOSX) | 964 #if !OS(MACOSX) |
962 const WebInputEvent::Type contextMenuTriggeringEventType = | 965 const WebInputEvent::Type contextMenuTriggeringEventType = |
963 #if OS(WIN) | 966 #if OS(WIN) |
964 WebInputEvent::KeyUp; | 967 WebInputEvent::KeyUp; |
965 #else | 968 #else |
966 WebInputEvent::RawKeyDown; | 969 WebInputEvent::RawKeyDown; |
967 #endif | 970 #endif |
968 | 971 |
969 bool isUnmodifiedMenuKey = !(event.modifiers & WebInputEvent::InputModifiers
) && event.windowsKeyCode == VKEY_APPS; | 972 bool isUnmodifiedMenuKey = !(event.modifiers & WebInputEvent::InputModifiers
) && event.windowsKeyCode == VKEY_APPS; |
(...skipping 3133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4103 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 4106 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
4104 | 4107 |
4105 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 4108 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
4106 return false; | 4109 return false; |
4107 | 4110 |
4108 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4111 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
4109 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 4112 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
4110 } | 4113 } |
4111 | 4114 |
4112 } // namespace blink | 4115 } // namespace blink |
OLD | NEW |