Changeset 130977 in webkit
- Timestamp:
- Oct 10, 2012, 4:23:13 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r130968 r130977 1 2012-10-10 Jon Lee <jonlee@apple.com> 2 3 [WK2] Activate plugins when user clicks on snapshot 4 https://bugs.webkit.org/show_bug.cgi?id=98328 5 <rdar://problem/12426681> 6 7 Reviewed by Brady Eidson. 8 9 Extend the default event handler to deal with plugins with snapshots. 10 When the user clicks on the placeholder, the plugin is recreated and displayed. 11 12 * loader/FrameLoaderClient.h: Add new client function recreatePlugin(), which is 13 expected to re-create the plugin with the same parameters as when it was run to 14 obtain the plugin's snapshot placeholder. 15 16 * loader/EmptyClients.cpp: Stub implementation of recreatePlugin(). 17 * loader/EmptyClients.h: 18 * WebCore.exp.in: Expose HTMLPlugInElement::pluginWidget(). 19 20 * html/HTMLPlugInElement.cpp: 21 (WebCore::HTMLPlugInElement::defaultEventHandler): Update to look for 22 RenderSnapshottedPlugIn. If the plugin is not playing, have the renderer handle the 23 event. 24 25 * rendering/RenderSnapshottedPlugIn.cpp: 26 (WebCore::RenderSnapshottedPlugin::getCursor): Set to hand cursor when the plugin is not 27 playing. 28 (WebCore::RenderSnapshottedPlugIn::handleEvent): If the user clicked on the plugin using the 29 left button, update the state of the element to playing. Recreate the plugin if the widget exists 30 to begin with. The cached snapshot image will be saved for possible reuse on back/forward navigation. 31 * rendering/RenderSnapshottedPlugIn.h: 32 (RenderSnapshottedPlugIn): 33 1 34 2012-10-10 Kenichi Ishibashi <bashi@chromium.org> 2 35 -
trunk/Source/WebCore/WebCore.exp.in
r130947 r130977 1234 1234 __ZNK7WebCore16VisibleSelection23isContentRichlyEditableEv 1235 1235 __ZNK7WebCore16VisibleSelection5isAllENS_27EditingBoundaryCrossingRuleE 1236 __ZNK7WebCore17HTMLPlugInElement12pluginWidgetEv 1236 1237 __ZNK7WebCore17JSDOMGlobalObject22scriptExecutionContextEv 1237 1238 __ZNK7WebCore17RegularExpression13matchedLengthEv -
trunk/Source/WebCore/html/HTMLPlugInElement.cpp
r130688 r130977 36 36 #include "PluginViewBase.h" 37 37 #include "RenderEmbeddedObject.h" 38 #include "RenderSnapshottedPlugIn.h" 38 39 #include "RenderWidget.h" 39 40 #include "Settings.h" … … 178 179 179 180 RenderObject* r = renderer(); 180 if (r && r->isEmbeddedObject() && toRenderEmbeddedObject(r)->showsUnavailablePluginIndicator()) { 181 toRenderEmbeddedObject(r)->handleUnavailablePluginIndicatorEvent(event); 182 return; 181 if (r && r->isEmbeddedObject()) { 182 if (toRenderEmbeddedObject(r)->showsUnavailablePluginIndicator()) { 183 toRenderEmbeddedObject(r)->handleUnavailablePluginIndicatorEvent(event); 184 return; 185 } 186 if (r->isSnapshottedPlugIn() && displayState() < Playing) { 187 toRenderSnapshottedPlugIn(r)->handleEvent(event); 188 return; 189 } 183 190 } 184 191 -
trunk/Source/WebCore/loader/EmptyClients.cpp
r127558 r130977 1 1 /* 2 2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org> 3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.3 * Copyright (C) 2008, 2009, 2012 Apple Inc. All rights reserved. 4 4 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 5 5 * … … 147 147 } 148 148 149 void EmptyFrameLoaderClient::recreatePlugin(Widget*) 150 { 151 } 152 149 153 PassRefPtr<Widget> EmptyFrameLoaderClient::createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const KURL&, const Vector<String>&, const Vector<String>&) 150 154 { -
trunk/Source/WebCore/loader/EmptyClients.h
r130400 r130977 1 1 /* 2 2 * Copyright (C) 2006 Eric Seidel (eric@webkit.org) 3 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.3 * Copyright (C) 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 4 4 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 5 5 * Copyright (C) 2012 Samsung Electronics. All rights reserved. … … 345 345 virtual PassRefPtr<Frame> createFrame(const KURL&, const String&, HTMLFrameOwnerElement*, const String&, bool, int, int) OVERRIDE; 346 346 virtual PassRefPtr<Widget> createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool) OVERRIDE; 347 virtual void recreatePlugin(Widget*) OVERRIDE; 347 348 virtual PassRefPtr<Widget> createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const KURL&, const Vector<String>&, const Vector<String>&) OVERRIDE; 348 349 #if ENABLE(PLUGIN_PROXY_FOR_VIDEO) -
trunk/Source/WebCore/loader/FrameLoaderClient.h
r130270 r130977 1 1 /* 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2012 Google Inc. All rights reserved. 4 4 * … … 263 263 virtual PassRefPtr<Frame> createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement, const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight) = 0; 264 264 virtual PassRefPtr<Widget> createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool loadManually) = 0; 265 virtual void recreatePlugin(Widget*) = 0; 265 266 virtual void redirectDataToPlugin(Widget* pluginWidget) = 0; 266 267 -
trunk/Source/WebCore/rendering/RenderSnapshottedPlugIn.cpp
r130810 r130977 28 28 29 29 #include "Cursor.h" 30 #include "FrameLoaderClient.h" 30 31 #include "FrameView.h" 31 32 #include "Gradient.h" 32 33 #include "HTMLPlugInImageElement.h" 34 #include "MouseEvent.h" 33 35 #include "PaintInfo.h" 34 36 #include "Path.h" … … 116 118 } 117 119 120 CursorDirective RenderSnapshottedPlugIn::getCursor(const LayoutPoint& point, Cursor& overrideCursor) const 121 { 122 if (plugInImageElement()->displayState() < HTMLPlugInElement::Playing) { 123 overrideCursor = handCursor(); 124 return SetCursor; 125 } 126 return RenderEmbeddedObject::getCursor(point, overrideCursor); 127 } 128 129 void RenderSnapshottedPlugIn::handleEvent(Event* event) 130 { 131 if (!event->isMouseEvent()) 132 return; 133 134 MouseEvent* mouseEvent = static_cast<MouseEvent*>(event); 135 if (event->type() == eventNames().clickEvent && mouseEvent->button() == LeftButton) { 136 plugInImageElement()->setDisplayState(HTMLPlugInElement::Playing); 137 if (widget()) { 138 if (Frame* frame = document()->frame()) 139 frame->loader()->client()->recreatePlugin(widget()); 140 repaint(); 141 } 142 event->setDefaultHandled(); 143 } 144 } 145 118 146 } // namespace WebCore -
trunk/Source/WebCore/rendering/RenderSnapshottedPlugIn.h
r130810 r130977 43 43 void updateSnapshot(PassRefPtr<Image>); 44 44 45 void handleEvent(Event*); 46 45 47 private: 46 48 HTMLPlugInImageElement* plugInImageElement() const; 47 49 virtual const char* renderName() const { return "RenderSnapshottedPlugIn"; } 48 50 51 virtual CursorDirective getCursor(const LayoutPoint&, Cursor&) const OVERRIDE; 49 52 virtual bool isSnapshottedPlugIn() const OVERRIDE { return true; } 50 53 virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE; -
trunk/Source/WebKit/chromium/ChangeLog
r130950 r130977 1 2012-10-10 Jon Lee <jonlee@apple.com> 2 3 [WK2] Activate plugins when user clicks on snapshot 4 https://bugs.webkit.org/show_bug.cgi?id=98328 5 <rdar://problem/12426681> 6 7 Reviewed by Brady Eidson. 8 9 * src/FrameLoaderClientImpl.h: 10 (WebKit::FrameLoaderClientImpl::recreatePlugin): Stub implementation of recreatePlugin(). 11 1 12 2012-10-10 David Barton <dbarton@mathscribe.com> 2 13 -
trunk/Source/WebKit/chromium/src/FrameLoaderClientImpl.h
r130270 r130977 183 183 const Vector<WTF::String>&, const Vector<WTF::String>&, 184 184 const WTF::String&, bool loadManually); 185 virtual void recreatePlugin(WebCore::Widget*) { } 185 186 virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget); 186 187 virtual PassRefPtr<WebCore::Widget> createJavaAppletWidget( -
trunk/Source/WebKit/efl/ChangeLog
r130881 r130977 1 2012-10-10 Jon Lee <jonlee@apple.com> 2 3 [WK2] Activate plugins when user clicks on snapshot 4 https://bugs.webkit.org/show_bug.cgi?id=98328 5 <rdar://problem/12426681> 6 7 Reviewed by Brady Eidson. 8 9 * WebCoreSupport/FrameLoaderClientEfl.h: 10 (WebCore::FrameLoaderClientEfl::recreatePlugin): Stub implementation of recreatePlugin(). 11 1 12 2012-10-10 Ryuan Choi <ryuan.choi@samsung.com> 2 13 -
trunk/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h
r129545 r130977 133 133 134 134 virtual PassRefPtr<Widget> createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, const WTF::Vector<String>&, const WTF::Vector<String>&, const String&, bool); 135 virtual void recreatePlugin(Widget*) { } 135 136 virtual void redirectDataToPlugin(Widget* pluginWidget); 136 137 virtual PassRefPtr<Widget> createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const KURL& baseURL, const WTF::Vector<String>& paramNames, const WTF::Vector<String>& paramValues); -
trunk/Source/WebKit/gtk/ChangeLog
r130867 r130977 1 2012-10-10 Jon Lee <jonlee@apple.com> 2 3 [WK2] Activate plugins when user clicks on snapshot 4 https://bugs.webkit.org/show_bug.cgi?id=98328 5 <rdar://problem/12426681> 6 7 Reviewed by Brady Eidson. 8 9 * WebCoreSupport/FrameLoaderClientGtk.h: 10 (WebKit::FrameLoaderClient::recreatePlugin): Stub implementation of recreatePlugin(). 11 1 12 2012-10-10 Sheriff Bot <webkit.review.bot@gmail.com> 2 13 -
trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h
r129545 r130977 115 115 const WTF::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight); 116 116 virtual PassRefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const WTF::Vector<WTF::String>&, const WTF::Vector<WTF::String>&, const WTF::String&, bool); 117 virtual void recreatePlugin(WebCore::Widget*) { } 117 118 virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget); 118 119 virtual PassRefPtr<WebCore::Widget> createJavaAppletWidget(const WebCore::IntSize&, WebCore::HTMLAppletElement*, const WebCore::KURL& baseURL, const WTF::Vector<WTF::String>& paramNames, const WTF::Vector<WTF::String>& paramValues); -
trunk/Source/WebKit/mac/ChangeLog
r130947 r130977 1 2012-10-10 Jon Lee <jonlee@apple.com> 2 3 [WK2] Activate plugins when user clicks on snapshot 4 https://bugs.webkit.org/show_bug.cgi?id=98328 5 <rdar://problem/12426681> 6 7 Reviewed by Brady Eidson. 8 9 * WebCoreSupport/WebFrameLoaderClient.h: 10 * WebCoreSupport/WebFrameLoaderClient.mm: 11 (WebFrameLoaderClient::recreatePlugin): Stub implementation of recreatePlugin(). 12 1 13 2012-10-10 Brady Eidson <beidson@apple.com> 2 14 -
trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
r129964 r130977 1 1 /* 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved.2 * Copyright (C) 2006, 2007, 2008, 2011, 2012 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 199 199 virtual PassRefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const Vector<WTF::String>&, 200 200 const Vector<WTF::String>&, const WTF::String&, bool) OVERRIDE; 201 virtual void recreatePlugin(WebCore::Widget*) OVERRIDE; 201 202 virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget) OVERRIDE; 202 203 -
trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
r129964 r130977 1 1 /* 2 * Copyright (C) 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights reserved.2 * Copyright (C) 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 1725 1725 } 1726 1726 1727 void WebFrameLoaderClient::recreatePlugin(Widget*) 1728 { 1729 } 1730 1727 1731 void WebFrameLoaderClient::redirectDataToPlugin(Widget* pluginWidget) 1728 1732 { -
trunk/Source/WebKit/qt/ChangeLog
r130898 r130977 1 2012-10-10 Jon Lee <jonlee@apple.com> 2 3 [WK2] Activate plugins when user clicks on snapshot 4 https://bugs.webkit.org/show_bug.cgi?id=98328 5 <rdar://problem/12426681> 6 7 Reviewed by Brady Eidson. 8 9 * WebCoreSupport/FrameLoaderClientQt.h: 10 (WebCore::FrameLoaderClientQt::recreatePlugin): Stub implementation of recreatePlugin(). 11 1 12 2012-10-10 Balazs Kelemen <kbalazs@webkit.org> 2 13 -
trunk/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
r129545 r130977 208 208 const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight); 209 209 virtual PassRefPtr<Widget> createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool); 210 virtual void recreatePlugin(Widget*) { } 210 211 virtual void redirectDataToPlugin(Widget* pluginWidget); 211 212 -
trunk/Source/WebKit/win/ChangeLog
r130947 r130977 1 2012-10-10 Jon Lee <jonlee@apple.com> 2 3 [WK2] Activate plugins when user clicks on snapshot 4 https://bugs.webkit.org/show_bug.cgi?id=98328 5 <rdar://problem/12426681> 6 7 Reviewed by Brady Eidson. 8 9 * WebCoreSupport/WebFrameLoaderClient.h: 10 (WebFrameLoaderClient::recreatePlugin): Stub implementation of recreatePlugin(). 11 1 12 2012-10-10 Brady Eidson <beidson@apple.com> 2 13 -
trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
r129545 r130977 116 116 const WTF::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight); 117 117 virtual PassRefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const Vector<WTF::String>&, const Vector<WTF::String>&, const WTF::String&, bool loadManually); 118 virtual void recreatePlugin(WebCore::Widget*) { } 118 119 virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget); 119 120 -
trunk/Source/WebKit/wince/ChangeLog
r130612 r130977 1 2012-10-10 Jon Lee <jonlee@apple.com> 2 3 [WK2] Activate plugins when user clicks on snapshot 4 https://bugs.webkit.org/show_bug.cgi?id=98328 5 <rdar://problem/12426681> 6 7 Reviewed by Brady Eidson. 8 9 * WebCoreSupport/FrameLoaderClientWinCE.h: 10 (WebKit::FrameLoaderClientWinCE::recreatePlugin): Stub implementation of recreatePlugin(). 11 1 12 2012-10-07 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> 2 13 -
trunk/Source/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.h
r129545 r130977 109 109 const WTF::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight); 110 110 virtual PassRefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const WTF::Vector<WTF::String>&, const WTF::Vector<WTF::String>&, const WTF::String&, bool); 111 virtual void recreatePlugin(WebCore::Widget*) { } 111 112 virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget); 112 113 virtual PassRefPtr<WebCore::Widget> createJavaAppletWidget(const WebCore::IntSize&, WebCore::HTMLAppletElement*, const WebCore::KURL& baseURL, const WTF::Vector<WTF::String>& paramNames, const WTF::Vector<WTF::String>& paramValues); -
trunk/Source/WebKit2/ChangeLog
r130973 r130977 1 2012-10-10 Jon Lee <jonlee@apple.com> 2 3 [WK2] Activate plugins when user clicks on snapshot 4 https://bugs.webkit.org/show_bug.cgi?id=98328 5 <rdar://problem/12426681> 6 7 Reviewed by Brady Eidson. 8 9 Implement the recreation of the plugin. 10 11 * WebProcess/Plugins/PluginView.cpp: 12 (WebKit::PluginView::recreateAndInitialize): We can run into a situation where the user 13 decided to run the plugin before the snapshot was ready to be taken. In this case, the 14 plugin member variable is non-null, and the timer is still active. Turn off the timer, and 15 destroy that instance of the plugin. We set the plugin to the instance provided in the 16 first parameter to this function, and reset the member variables so that the PluginView is 17 in a state similar to when it was first created. We also immediately initialize the plugin, 18 which may happen synchronously or asynchronously. 19 20 * WebProcess/Plugins/PluginView.h: 21 (WebKit::PluginView::initialParameters): Expose the initial parameters. Used to recreate 22 the plugin. 23 (WebKit::PluginView::pluginElement): Expose the element associated with the widget. Used to 24 recreate the plugin. 25 26 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: 27 (WebKit::WebFrameLoaderClient::recreatePlugin): Create a new Plugin instance using the same 28 parameters used to create the plugin for snapshotting. Forward that instance to the widget. 29 * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 30 (WebFrameLoaderClient): Implement recreatePlugin(). 31 1 32 2012-10-10 Sam Weinig <sam@webkit.org> 2 33 -
trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp
r130810 r130977 317 317 } 318 318 319 void PluginView::recreateAndInitialize(PassRefPtr<Plugin> plugin) 320 { 321 if (m_plugin) { 322 if (m_pluginSnapshotTimer.isActive()) 323 m_pluginSnapshotTimer.stop(); 324 destroyPluginAndReset(); 325 } 326 327 // Reset member variables to initial values. 328 m_plugin = plugin; 329 m_isInitialized = false; 330 m_isWaitingForSynchronousInitialization = false; 331 m_isWaitingUntilMediaCanStart = false; 332 m_isBeingDestroyed = false; 333 m_manualStreamState = StreamStateInitial; 334 m_transientPaintingSnapshot = nullptr; 335 336 initializePlugin(); 337 } 338 319 339 Frame* PluginView::frame() const 320 340 { -
trunk/Source/WebKit2/WebProcess/Plugins/PluginView.h
r130810 r130977 54 54 static PassRefPtr<PluginView> create(PassRefPtr<WebCore::HTMLPlugInElement>, PassRefPtr<Plugin>, const Plugin::Parameters&); 55 55 56 void recreateAndInitialize(PassRefPtr<Plugin>); 57 56 58 WebCore::Frame* frame() const; 57 59 … … 72 74 RetainPtr<PDFDocument> pdfDocumentForPrinting() const { return m_plugin->pdfDocumentForPrinting(); } 73 75 #endif 76 77 WebCore::HTMLPlugInElement* pluginElement() const { return m_pluginElement.get(); } 78 const Plugin::Parameters& initialParameters() const { return m_parameters; } 74 79 75 80 // FIXME: Remove this; nobody should have to know about the plug-in view's renderer except the plug-in view itself. -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r130029 r130977 1 1 /* 2 * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.2 * Copyright (C) 2010, 2011, 2012 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 1354 1354 } 1355 1355 1356 void WebFrameLoaderClient::recreatePlugin(Widget* widget) 1357 { 1358 ASSERT(widget && widget->isPluginViewBase()); 1359 ASSERT(m_frame->page()); 1360 1361 PluginView* pluginView = static_cast<PluginView*>(widget); 1362 RefPtr<Plugin> plugin = m_frame->page()->createPlugin(m_frame, pluginView->pluginElement(), pluginView->initialParameters()); 1363 pluginView->recreateAndInitialize(plugin.release()); 1364 } 1365 1356 1366 void WebFrameLoaderClient::redirectDataToPlugin(Widget* pluginWidget) 1357 1367 { -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h
r130029 r130977 1 1 /* 2 * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.2 * Copyright (C) 2010, 2011, 2012 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 189 189 190 190 virtual PassRefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const Vector<String>&, const Vector<String>&, const String&, bool loadManually) OVERRIDE; 191 virtual void recreatePlugin(WebCore::Widget*) OVERRIDE; 191 192 virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget) OVERRIDE; 192 193
Note:
See TracChangeset
for help on using the changeset viewer.