| 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 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1137 if (result != WebInputEventResult::NotHandled) { | 1137 if (result != WebInputEventResult::NotHandled) { |
| 1138 if (WebInputEvent::RawKeyDown == event.type()) { | 1138 if (WebInputEvent::RawKeyDown == event.type()) { |
| 1139 // Suppress the next keypress event unless the focused node is a plugin | 1139 // Suppress the next keypress event unless the focused node is a plugin |
| 1140 // node. (Flash needs these keypress events to handle non-US keyboards.) | 1140 // node. (Flash needs these keypress events to handle non-US keyboards.) |
| 1141 Element* element = focusedElement(); | 1141 Element* element = focusedElement(); |
| 1142 if (element && element->layoutObject() && | 1142 if (element && element->layoutObject() && |
| 1143 element->layoutObject()->isEmbeddedObject()) { | 1143 element->layoutObject()->isEmbeddedObject()) { |
| 1144 if (event.windowsKeyCode == VKEY_TAB) { | 1144 if (event.windowsKeyCode == VKEY_TAB) { |
| 1145 // If the plugin supports keyboard focus then we should not send a tab | 1145 // If the plugin supports keyboard focus then we should not send a tab |
| 1146 // keypress event. | 1146 // keypress event. |
| 1147 FrameViewBase* frameViewBase = | 1147 PluginView* pluginView = |
| 1148 toLayoutPart(element->layoutObject())->frameViewBase(); | 1148 toLayoutPart(element->layoutObject())->plugin(); |
| 1149 if (frameViewBase && frameViewBase->isPluginContainer()) { | 1149 if (pluginView && pluginView->isPluginContainer()) { |
| 1150 WebPluginContainerImpl* plugin = | 1150 WebPluginContainerImpl* plugin = |
| 1151 toWebPluginContainerImpl(frameViewBase); | 1151 toWebPluginContainerImpl(pluginView); |
| 1152 if (plugin && plugin->supportsKeyboardFocus()) | 1152 if (plugin && plugin->supportsKeyboardFocus()) |
| 1153 m_suppressNextKeypressEvent = true; | 1153 m_suppressNextKeypressEvent = true; |
| 1154 } | 1154 } |
| 1155 } | 1155 } |
| 1156 } else { | 1156 } else { |
| 1157 m_suppressNextKeypressEvent = true; | 1157 m_suppressNextKeypressEvent = true; |
| 1158 } | 1158 } |
| 1159 } | 1159 } |
| 1160 return result; | 1160 return result; |
| 1161 } | 1161 } |
| (...skipping 2163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3325 void WebViewImpl::performPluginAction(const WebPluginAction& action, | 3325 void WebViewImpl::performPluginAction(const WebPluginAction& action, |
| 3326 const WebPoint& location) { | 3326 const WebPoint& location) { |
| 3327 // FIXME: Location is probably in viewport coordinates | 3327 // FIXME: Location is probably in viewport coordinates |
| 3328 HitTestResult result = hitTestResultForRootFramePos(location); | 3328 HitTestResult result = hitTestResultForRootFramePos(location); |
| 3329 Node* node = result.innerNode(); | 3329 Node* node = result.innerNode(); |
| 3330 if (!isHTMLObjectElement(*node) && !isHTMLEmbedElement(*node)) | 3330 if (!isHTMLObjectElement(*node) && !isHTMLEmbedElement(*node)) |
| 3331 return; | 3331 return; |
| 3332 | 3332 |
| 3333 LayoutObject* object = node->layoutObject(); | 3333 LayoutObject* object = node->layoutObject(); |
| 3334 if (object && object->isLayoutPart()) { | 3334 if (object && object->isLayoutPart()) { |
| 3335 FrameViewBase* frameViewWidget = toLayoutPart(object)->frameViewBase(); | 3335 PluginView* pluginView = toLayoutPart(object)->plugin(); |
| 3336 if (frameViewWidget && frameViewWidget->isPluginContainer()) { | 3336 if (pluginView && pluginView->isPluginContainer()) { |
| 3337 WebPluginContainerImpl* plugin = | 3337 WebPluginContainerImpl* plugin = toWebPluginContainerImpl(pluginView); |
| 3338 toWebPluginContainerImpl(frameViewWidget); | |
| 3339 switch (action.type) { | 3338 switch (action.type) { |
| 3340 case WebPluginAction::Rotate90Clockwise: | 3339 case WebPluginAction::Rotate90Clockwise: |
| 3341 plugin->plugin()->rotateView(WebPlugin::RotationType90Clockwise); | 3340 plugin->plugin()->rotateView(WebPlugin::RotationType90Clockwise); |
| 3342 break; | 3341 break; |
| 3343 case WebPluginAction::Rotate90Counterclockwise: | 3342 case WebPluginAction::Rotate90Counterclockwise: |
| 3344 plugin->plugin()->rotateView( | 3343 plugin->plugin()->rotateView( |
| 3345 WebPlugin::RotationType90Counterclockwise); | 3344 WebPlugin::RotationType90Counterclockwise); |
| 3346 break; | 3345 break; |
| 3347 default: | 3346 default: |
| 3348 NOTREACHED(); | 3347 NOTREACHED(); |
| (...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4177 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) | 4176 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) |
| 4178 return nullptr; | 4177 return nullptr; |
| 4179 return focusedFrame; | 4178 return focusedFrame; |
| 4180 } | 4179 } |
| 4181 | 4180 |
| 4182 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { | 4181 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { |
| 4183 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; | 4182 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; |
| 4184 } | 4183 } |
| 4185 | 4184 |
| 4186 } // namespace blink | 4185 } // namespace blink |
| OLD | NEW |