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

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

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

Powered by Google App Engine
This is Rietveld 408576698