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