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

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

Issue 2764313002: Move plugins to be stored in HTMLPlugInElement. (Closed)
Patch Set: Update comments about duplicating code 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 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after
1202 if (result != WebInputEventResult::NotHandled) { 1202 if (result != WebInputEventResult::NotHandled) {
1203 if (WebInputEvent::RawKeyDown == event.type()) { 1203 if (WebInputEvent::RawKeyDown == event.type()) {
1204 // Suppress the next keypress event unless the focused node is a plugin 1204 // Suppress the next keypress event unless the focused node is a plugin
1205 // node. (Flash needs these keypress events to handle non-US keyboards.) 1205 // node. (Flash needs these keypress events to handle non-US keyboards.)
1206 Element* element = focusedElement(); 1206 Element* element = focusedElement();
1207 if (element && element->layoutObject() && 1207 if (element && element->layoutObject() &&
1208 element->layoutObject()->isEmbeddedObject()) { 1208 element->layoutObject()->isEmbeddedObject()) {
1209 if (event.windowsKeyCode == VKEY_TAB) { 1209 if (event.windowsKeyCode == VKEY_TAB) {
1210 // If the plugin supports keyboard focus then we should not send a tab 1210 // If the plugin supports keyboard focus then we should not send a tab
1211 // keypress event. 1211 // keypress event.
1212 FrameViewBase* frameViewBase = 1212 PluginView* pluginView =
1213 toLayoutPart(element->layoutObject())->frameViewBase(); 1213 toLayoutPart(element->layoutObject())->plugin();
1214 if (frameViewBase && frameViewBase->isPluginContainer()) { 1214 if (pluginView && pluginView->isPluginContainer()) {
1215 WebPluginContainerImpl* plugin = 1215 WebPluginContainerImpl* plugin =
1216 toWebPluginContainerImpl(frameViewBase); 1216 toWebPluginContainerImpl(pluginView);
1217 if (plugin && plugin->supportsKeyboardFocus()) 1217 if (plugin && plugin->supportsKeyboardFocus())
1218 m_suppressNextKeypressEvent = true; 1218 m_suppressNextKeypressEvent = true;
1219 } 1219 }
1220 } 1220 }
1221 } else { 1221 } else {
1222 m_suppressNextKeypressEvent = true; 1222 m_suppressNextKeypressEvent = true;
1223 } 1223 }
1224 } 1224 }
1225 return result; 1225 return result;
1226 } 1226 }
(...skipping 2166 matching lines...) Expand 10 before | Expand all | Expand 10 after
3393 void WebViewImpl::performPluginAction(const WebPluginAction& action, 3393 void WebViewImpl::performPluginAction(const WebPluginAction& action,
3394 const WebPoint& location) { 3394 const WebPoint& location) {
3395 // FIXME: Location is probably in viewport coordinates 3395 // FIXME: Location is probably in viewport coordinates
3396 HitTestResult result = hitTestResultForRootFramePos(location); 3396 HitTestResult result = hitTestResultForRootFramePos(location);
3397 Node* node = result.innerNode(); 3397 Node* node = result.innerNode();
3398 if (!isHTMLObjectElement(*node) && !isHTMLEmbedElement(*node)) 3398 if (!isHTMLObjectElement(*node) && !isHTMLEmbedElement(*node))
3399 return; 3399 return;
3400 3400
3401 LayoutObject* object = node->layoutObject(); 3401 LayoutObject* object = node->layoutObject();
3402 if (object && object->isLayoutPart()) { 3402 if (object && object->isLayoutPart()) {
3403 FrameViewBase* frameViewWidget = toLayoutPart(object)->frameViewBase(); 3403 PluginView* pluginView = toLayoutPart(object)->plugin();
3404 if (frameViewWidget && frameViewWidget->isPluginContainer()) { 3404 if (pluginView && pluginView->isPluginContainer()) {
3405 WebPluginContainerImpl* plugin = 3405 WebPluginContainerImpl* plugin = toWebPluginContainerImpl(pluginView);
3406 toWebPluginContainerImpl(frameViewWidget);
3407 switch (action.type) { 3406 switch (action.type) {
3408 case WebPluginAction::Rotate90Clockwise: 3407 case WebPluginAction::Rotate90Clockwise:
3409 plugin->plugin()->rotateView(WebPlugin::RotationType90Clockwise); 3408 plugin->plugin()->rotateView(WebPlugin::RotationType90Clockwise);
3410 break; 3409 break;
3411 case WebPluginAction::Rotate90Counterclockwise: 3410 case WebPluginAction::Rotate90Counterclockwise:
3412 plugin->plugin()->rotateView( 3411 plugin->plugin()->rotateView(
3413 WebPlugin::RotationType90Counterclockwise); 3412 WebPlugin::RotationType90Counterclockwise);
3414 break; 3413 break;
3415 default: 3414 default:
3416 NOTREACHED(); 3415 NOTREACHED();
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after
4231 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) 4230 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame())
4232 return nullptr; 4231 return nullptr;
4233 return focusedFrame; 4232 return focusedFrame;
4234 } 4233 }
4235 4234
4236 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { 4235 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const {
4237 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; 4236 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr;
4238 } 4237 }
4239 4238
4240 } // namespace blink 4239 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698