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 2888283004: Revert of Introduce WebPluginContainerBase to abstract WebPluginContainerImpl. (Closed)
Patch Set: Created 3 years, 7 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 #include "core/editing/Editor.h" 44 #include "core/editing/Editor.h"
45 #include "core/editing/FrameSelection.h" 45 #include "core/editing/FrameSelection.h"
46 #include "core/editing/InputMethodController.h" 46 #include "core/editing/InputMethodController.h"
47 #include "core/editing/iterators/TextIterator.h" 47 #include "core/editing/iterators/TextIterator.h"
48 #include "core/editing/serializers/HTMLInterchange.h" 48 #include "core/editing/serializers/HTMLInterchange.h"
49 #include "core/editing/serializers/Serialization.h" 49 #include "core/editing/serializers/Serialization.h"
50 #include "core/events/KeyboardEvent.h" 50 #include "core/events/KeyboardEvent.h"
51 #include "core/events/UIEventWithKeyState.h" 51 #include "core/events/UIEventWithKeyState.h"
52 #include "core/events/WebInputEventConversion.h" 52 #include "core/events/WebInputEventConversion.h"
53 #include "core/events/WheelEvent.h" 53 #include "core/events/WheelEvent.h"
54 #include "core/exported/WebPluginContainerBase.h"
55 #include "core/frame/BrowserControls.h" 54 #include "core/frame/BrowserControls.h"
56 #include "core/frame/EventHandlerRegistry.h" 55 #include "core/frame/EventHandlerRegistry.h"
57 #include "core/frame/FrameView.h" 56 #include "core/frame/FrameView.h"
58 #include "core/frame/LocalFrame.h" 57 #include "core/frame/LocalFrame.h"
59 #include "core/frame/LocalFrameClient.h" 58 #include "core/frame/LocalFrameClient.h"
60 #include "core/frame/PageScaleConstraintsSet.h" 59 #include "core/frame/PageScaleConstraintsSet.h"
61 #include "core/frame/RemoteFrame.h" 60 #include "core/frame/RemoteFrame.h"
62 #include "core/frame/ResizeViewportAnchor.h" 61 #include "core/frame/ResizeViewportAnchor.h"
63 #include "core/frame/RotationViewportAnchor.h" 62 #include "core/frame/RotationViewportAnchor.h"
64 #include "core/frame/Settings.h" 63 #include "core/frame/Settings.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 #include "web/DevToolsEmulator.h" 164 #include "web/DevToolsEmulator.h"
166 #include "web/FullscreenController.h" 165 #include "web/FullscreenController.h"
167 #include "web/LinkHighlightImpl.h" 166 #include "web/LinkHighlightImpl.h"
168 #include "web/PageOverlay.h" 167 #include "web/PageOverlay.h"
169 #include "web/PrerendererClientImpl.h" 168 #include "web/PrerendererClientImpl.h"
170 #include "web/StorageQuotaClientImpl.h" 169 #include "web/StorageQuotaClientImpl.h"
171 #include "web/ValidationMessageClientImpl.h" 170 #include "web/ValidationMessageClientImpl.h"
172 #include "web/WebDevToolsAgentImpl.h" 171 #include "web/WebDevToolsAgentImpl.h"
173 #include "web/WebInputMethodControllerImpl.h" 172 #include "web/WebInputMethodControllerImpl.h"
174 #include "web/WebLocalFrameImpl.h" 173 #include "web/WebLocalFrameImpl.h"
174 #include "web/WebPluginContainerImpl.h"
175 #include "web/WebRemoteFrameImpl.h" 175 #include "web/WebRemoteFrameImpl.h"
176 #include "web/WebSettingsImpl.h" 176 #include "web/WebSettingsImpl.h"
177 177
178 #if USE(DEFAULT_RENDER_THEME) 178 #if USE(DEFAULT_RENDER_THEME)
179 #include "core/layout/LayoutThemeDefault.h" 179 #include "core/layout/LayoutThemeDefault.h"
180 #endif 180 #endif
181 181
182 // Get rid of WTF's pow define so we can use std::pow. 182 // Get rid of WTF's pow define so we can use std::pow.
183 #undef pow 183 #undef pow
184 #include <cmath> // for std::pow 184 #include <cmath> // for std::pow
(...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after
1169 // node. (Flash needs these keypress events to handle non-US keyboards.) 1169 // node. (Flash needs these keypress events to handle non-US keyboards.)
1170 Element* element = FocusedElement(); 1170 Element* element = FocusedElement();
1171 if (element && element->GetLayoutObject() && 1171 if (element && element->GetLayoutObject() &&
1172 element->GetLayoutObject()->IsEmbeddedObject()) { 1172 element->GetLayoutObject()->IsEmbeddedObject()) {
1173 if (event.windows_key_code == VKEY_TAB) { 1173 if (event.windows_key_code == VKEY_TAB) {
1174 // If the plugin supports keyboard focus then we should not send a tab 1174 // If the plugin supports keyboard focus then we should not send a tab
1175 // keypress event. 1175 // keypress event.
1176 PluginView* plugin_view = 1176 PluginView* plugin_view =
1177 ToLayoutPart(element->GetLayoutObject())->Plugin(); 1177 ToLayoutPart(element->GetLayoutObject())->Plugin();
1178 if (plugin_view && plugin_view->IsPluginContainer()) { 1178 if (plugin_view && plugin_view->IsPluginContainer()) {
1179 WebPluginContainerBase* plugin = 1179 WebPluginContainerImpl* plugin =
1180 ToWebPluginContainerBase(plugin_view); 1180 ToWebPluginContainerImpl(plugin_view);
1181 if (plugin && plugin->SupportsKeyboardFocus()) 1181 if (plugin && plugin->SupportsKeyboardFocus())
1182 suppress_next_keypress_event_ = true; 1182 suppress_next_keypress_event_ = true;
1183 } 1183 }
1184 } 1184 }
1185 } else { 1185 } else {
1186 suppress_next_keypress_event_ = true; 1186 suppress_next_keypress_event_ = true;
1187 } 1187 }
1188 } 1188 }
1189 return result; 1189 return result;
1190 } 1190 }
(...skipping 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after
2412 focus = local_frame->View()->ContentsToViewport(focus); 2412 focus = local_frame->View()->ContentsToViewport(focus);
2413 2413
2414 if (!selection.ComputeVisibleSelectionInDOMTree().IsBaseFirst()) 2414 if (!selection.ComputeVisibleSelectionInDOMTree().IsBaseFirst())
2415 std::swap(anchor, focus); 2415 std::swap(anchor, focus);
2416 return true; 2416 return true;
2417 } 2417 }
2418 2418
2419 // TODO(ekaramad):This method is almost duplicated in WebFrameWidgetImpl as 2419 // TODO(ekaramad):This method is almost duplicated in WebFrameWidgetImpl as
2420 // well. This code needs to be refactored (http://crbug.com/629721). 2420 // well. This code needs to be refactored (http://crbug.com/629721).
2421 WebPlugin* WebViewImpl::FocusedPluginIfInputMethodSupported(LocalFrame* frame) { 2421 WebPlugin* WebViewImpl::FocusedPluginIfInputMethodSupported(LocalFrame* frame) {
2422 WebPluginContainerBase* container = 2422 WebPluginContainerImpl* container =
2423 WebLocalFrameImpl::CurrentPluginContainer(frame); 2423 WebLocalFrameImpl::CurrentPluginContainer(frame);
2424 if (container && container->SupportsInputMethod()) 2424 if (container && container->SupportsInputMethod())
2425 return container->Plugin(); 2425 return container->Plugin();
2426 return nullptr; 2426 return nullptr;
2427 } 2427 }
2428 2428
2429 // TODO(ekaramad):This method is almost duplicated in WebFrameWidgetImpl as 2429 // TODO(ekaramad):This method is almost duplicated in WebFrameWidgetImpl as
2430 // well. This code needs to be refactored (http://crbug.com/629721). 2430 // well. This code needs to be refactored (http://crbug.com/629721).
2431 bool WebViewImpl::SelectionTextDirection(WebTextDirection& start, 2431 bool WebViewImpl::SelectionTextDirection(WebTextDirection& start,
2432 WebTextDirection& end) const { 2432 WebTextDirection& end) const {
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after
3372 // FIXME: Location is probably in viewport coordinates 3372 // FIXME: Location is probably in viewport coordinates
3373 HitTestResult result = HitTestResultForRootFramePos(location); 3373 HitTestResult result = HitTestResultForRootFramePos(location);
3374 Node* node = result.InnerNode(); 3374 Node* node = result.InnerNode();
3375 if (!isHTMLObjectElement(*node) && !isHTMLEmbedElement(*node)) 3375 if (!isHTMLObjectElement(*node) && !isHTMLEmbedElement(*node))
3376 return; 3376 return;
3377 3377
3378 LayoutObject* object = node->GetLayoutObject(); 3378 LayoutObject* object = node->GetLayoutObject();
3379 if (object && object->IsLayoutPart()) { 3379 if (object && object->IsLayoutPart()) {
3380 PluginView* plugin_view = ToLayoutPart(object)->Plugin(); 3380 PluginView* plugin_view = ToLayoutPart(object)->Plugin();
3381 if (plugin_view && plugin_view->IsPluginContainer()) { 3381 if (plugin_view && plugin_view->IsPluginContainer()) {
3382 WebPluginContainerBase* plugin = ToWebPluginContainerBase(plugin_view); 3382 WebPluginContainerImpl* plugin = ToWebPluginContainerImpl(plugin_view);
3383 switch (action.type) { 3383 switch (action.type) {
3384 case WebPluginAction::kRotate90Clockwise: 3384 case WebPluginAction::kRotate90Clockwise:
3385 plugin->Plugin()->RotateView(WebPlugin::kRotationType90Clockwise); 3385 plugin->Plugin()->RotateView(WebPlugin::kRotationType90Clockwise);
3386 break; 3386 break;
3387 case WebPluginAction::kRotate90Counterclockwise: 3387 case WebPluginAction::kRotate90Counterclockwise:
3388 plugin->Plugin()->RotateView( 3388 plugin->Plugin()->RotateView(
3389 WebPlugin::kRotationType90Counterclockwise); 3389 WebPlugin::kRotationType90Counterclockwise);
3390 break; 3390 break;
3391 default: 3391 default:
3392 NOTREACHED(); 3392 NOTREACHED();
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
4151 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame()) 4151 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame())
4152 return nullptr; 4152 return nullptr;
4153 return focused_frame; 4153 return focused_frame;
4154 } 4154 }
4155 4155
4156 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const { 4156 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const {
4157 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr; 4157 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr;
4158 } 4158 }
4159 4159
4160 } // namespace blink 4160 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebPluginDocument.cpp ('k') | third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698