2010-12-21 Anders Carlsson <andersca@apple.com>
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Dec 2010 18:29:57 +0000 (18:29 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Dec 2010 18:29:57 +0000 (18:29 +0000)
        Reviewed by John Sullivan.

        Clicking missing plug-in text does not show a sheet
        https://bugs.webkit.org/show_bug.cgi?id=51403

        * WebCore.exp.in:
        Export symbols needed by WebKit2.

        * WebCore.xcodeproj/project.pbxproj:
        Make HTMLPlugInImageElement.h a private header.

        * html/HTMLPlugInImageElement.h:
        (WebCore::HTMLPlugInImageElement::serviceType):
        (WebCore::HTMLPlugInImageElement::url):
        Make these member functions public.
2010-12-21  Anders Carlsson  <andersca@apple.com>

        Reviewed by John Sullivan.

        Clicking missing plug-in text does not show a sheet
        https://bugs.webkit.org/show_bug.cgi?id=51403

        Update for changes to the WebPageUIClient.

        * MiniBrowser/mac/BrowserWindowController.m:
        (-[BrowserWindowController awakeFromNib]):
        * WebKitTestRunner/TestController.cpp:
        (WTR::createOtherPage):
        (WTR::TestController::initialize):
2010-12-21  Anders Carlsson  <andersca@apple.com>

        Reviewed by John Sullivan.

        Clicking missing plug-in text does not show a sheet
        https://bugs.webkit.org/show_bug.cgi?id=51403

        * UIProcess/API/C/WKPage.h:
        Add missingPluginButtonClicked to WKPageUIClient.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::missingPluginButtonClicked):
        Call the WebUIClient member function.

        * UIProcess/WebPageProxy.messages.in:
        Add MissingPluginButtonClicked message.

        * UIProcess/WebUIClient.cpp:
        (WebKit::WebUIClient::missingPluginButtonClicked):
        Call the WKPageUIClient callback.

        * UIProcess/WebUIClient.h:
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::shouldMissingPluginMessageBeButton):
        Always return true for now.

        (WebKit::WebChromeClient::missingPluginButtonClicked):
        Send a MissingPluginButtonClicked message.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@74418 268f45cc-cd09-0410-ab3c-d52691b4dbfc

17 files changed:
Tools/ChangeLog
Tools/MiniBrowser/mac/BrowserWindowController.m
Tools/WebKitTestRunner/TestController.cpp
WebCore/ChangeLog
WebCore/WebCore.exp.in
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/html/HTMLPlugInImageElement.h
WebKit2/ChangeLog
WebKit2/UIProcess/API/C/WKPage.h
WebKit2/UIProcess/API/qt/qwkpage.cpp
WebKit2/UIProcess/WebPageProxy.cpp
WebKit2/UIProcess/WebPageProxy.h
WebKit2/UIProcess/WebPageProxy.messages.in
WebKit2/UIProcess/WebUIClient.cpp
WebKit2/UIProcess/WebUIClient.h
WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h

index c949b21..9d97b9b 100644 (file)
@@ -1,3 +1,18 @@
+2010-12-21  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by John Sullivan.
+
+        Clicking missing plug-in text does not show a sheet
+        https://bugs.webkit.org/show_bug.cgi?id=51403
+
+        Update for changes to the WebPageUIClient.
+
+        * MiniBrowser/mac/BrowserWindowController.m:
+        (-[BrowserWindowController awakeFromNib]):
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::createOtherPage):
+        (WTR::TestController::initialize):
+
 2010-12-21  Eric Seidel  <eric@webkit.org>
 
         Reviewed by Adam Barth.
index b813f29..0fa4755 100644 (file)
@@ -621,6 +621,7 @@ static void runOpenPanel(WKPageRef page, WKFrameRef frame, WKOpenPanelParameters
         runJavaScriptPrompt,
         setStatusText,
         mouseDidMoveOverElement,
+        0,          /* missingPluginButtonClicked */
         0,          /* didNotHandleKeyEvent */
         0,          /* toolbarsAreVisible */
         0,          /* setToolbarsAreVisible */
index a8ad1f2..77213a2 100644 (file)
@@ -122,6 +122,7 @@ static WKPageRef createOtherPage(WKPageRef oldPage, WKDictionaryRef, WKEventModi
         0, // runJavaScriptPrompt
         0, // setStatusText
         0, // mouseDidMoveOverElement
+        0, // missingPluginButtonClicked
         0, // didNotHandleKeyEvent
         0, // toolbarsAreVisible
         0, // setToolbarsAreVisible
@@ -225,6 +226,7 @@ void TestController::initialize(int argc, const char* argv[])
         0, // runJavaScriptPrompt
         0, // setStatusText
         0, // mouseDidMoveOverElement
+        0, // missingPluginButtonClicked
         0, // didNotHandleKeyEvent
         0, // toolbarsAreVisible
         0, // setToolbarsAreVisible
index d1db7cc..f4f20ea 100644 (file)
@@ -1,3 +1,21 @@
+2010-12-21  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by John Sullivan.
+
+        Clicking missing plug-in text does not show a sheet
+        https://bugs.webkit.org/show_bug.cgi?id=51403
+
+        * WebCore.exp.in:
+        Export symbols needed by WebKit2.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        Make HTMLPlugInImageElement.h a private header.
+
+        * html/HTMLPlugInImageElement.h:
+        (WebCore::HTMLPlugInImageElement::serviceType):
+        (WebCore::HTMLPlugInImageElement::url):
+        Make these member functions public.
+
 2010-12-21  Andras Becsi  <abecsi@webkit.org>
 
         Unreviewed build fix.
index f7706e7..4c97a1b 100644 (file)
@@ -893,11 +893,13 @@ __ZN7WebCore9HTMLNames6imgTagE
 __ZN7WebCore9HTMLNames6preTagE
 __ZN7WebCore9HTMLNames7formTagE
 __ZN7WebCore9HTMLNames7srcAttrE
+__ZN7WebCore9HTMLNames8embedTagE
 __ZN7WebCore9HTMLNames8frameTagE
 __ZN7WebCore9HTMLNames8hrefAttrE
 __ZN7WebCore9HTMLNames8inputTagE
 __ZN7WebCore9HTMLNames8videoTagE
 __ZN7WebCore9HTMLNames9iframeTagE
+__ZN7WebCore9HTMLNames9objectTagE
 __ZN7WebCore9HTMLNames9scriptTagE
 __ZN7WebCore9JSElement6s_infoE
 __ZN7WebCore9PageCache11setCapacityEi
index 3052fc1..0ed9320 100644 (file)
                41F1D21F0EF35C2A00DA8753 /* ScriptCachedFrameData.h in Headers */ = {isa = PBXBuildFile; fileRef = 41F1D21D0EF35C2A00DA8753 /* ScriptCachedFrameData.h */; settings = {ATTRIBUTES = (Private, ); }; };
                41F1D2200EF35C2A00DA8753 /* ScriptCachedFrameData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41F1D21E0EF35C2A00DA8753 /* ScriptCachedFrameData.cpp */; };
                41F584C7104652CB009CAA64 /* JSMessagePortCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = 41F584C6104652CB009CAA64 /* JSMessagePortCustom.h */; };
-               4415292E0E1AE8A000C4A2D0 /* HTMLPlugInImageElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 4415292C0E1AE8A000C4A2D0 /* HTMLPlugInImageElement.h */; };
+               4415292E0E1AE8A000C4A2D0 /* HTMLPlugInImageElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 4415292C0E1AE8A000C4A2D0 /* HTMLPlugInImageElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
                4415292F0E1AE8A000C4A2D0 /* HTMLPlugInImageElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4415292D0E1AE8A000C4A2D0 /* HTMLPlugInImageElement.cpp */; };
                441B055C0CD77A2D007C1F18 /* DOMHTMLEmbedElementPrivate.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 4429AAFB0CB84E88007647C5 /* DOMHTMLEmbedElementPrivate.h */; };
                441B055E0CD77A48007C1F18 /* DOMHTMLIFrameElementPrivate.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 4429AAFD0CB84EA5007647C5 /* DOMHTMLIFrameElementPrivate.h */; };
index 9616fe8..377fd99 100644 (file)
@@ -36,14 +36,14 @@ public:
 
     virtual void updateWidget(bool onlyCreateNonNetscapePlugins) = 0;
 
+    const String& serviceType() const { return m_serviceType; }
+    const String& url() const { return m_url; }
+
 protected:
     HTMLPlugInImageElement(const QualifiedName& tagName, Document*, bool createdByParser);
 
     bool isImageType();
 
-    const String& serviceType() const { return m_serviceType; }
-    const String& url() const { return m_url; }
-
     OwnPtr<HTMLImageLoader> m_imageLoader;
     String m_serviceType;
     String m_url;
index 2ecaacc..cebb183 100644 (file)
@@ -1,3 +1,32 @@
+2010-12-21  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by John Sullivan.
+
+        Clicking missing plug-in text does not show a sheet
+        https://bugs.webkit.org/show_bug.cgi?id=51403
+
+        * UIProcess/API/C/WKPage.h:
+        Add missingPluginButtonClicked to WKPageUIClient.
+
+        * UIProcess/WebPageProxy.cpp:        
+        (WebKit::WebPageProxy::missingPluginButtonClicked):
+        Call the WebUIClient member function.
+
+        * UIProcess/WebPageProxy.messages.in:
+        Add MissingPluginButtonClicked message.
+
+        * UIProcess/WebUIClient.cpp:
+        (WebKit::WebUIClient::missingPluginButtonClicked):
+        Call the WKPageUIClient callback.
+
+        * UIProcess/WebUIClient.h:
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::shouldMissingPluginMessageBeButton):
+        Always return true for now.
+
+        (WebKit::WebChromeClient::missingPluginButtonClicked):
+        Send a MissingPluginButtonClicked message.
+
 2010-12-21  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
 
         Reviewed by Andreas Kling.
index 245d219..a03d2bf 100644 (file)
@@ -159,6 +159,7 @@ typedef bool (*WKPageRunJavaScriptConfirmCallback)(WKPageRef page, WKStringRef m
 typedef WKStringRef (*WKPageRunJavaScriptPromptCallback)(WKPageRef page, WKStringRef message, WKStringRef defaultValue, WKFrameRef frame, const void *clientInfo);
 typedef void (*WKPageSetStatusTextCallback)(WKPageRef page, WKStringRef text, const void *clientInfo);
 typedef void (*WKPageMouseDidMoveOverElementCallback)(WKPageRef page, WKEventModifiers modifiers, WKTypeRef userData, const void *clientInfo);
+typedef void (*WKPageMissingPluginButtonClickedCallback)(WKPageRef page, WKStringRef mimeType, WKStringRef url, const void* clientInfo);
 typedef void (*WKPageDidNotHandleKeyEventCallback)(WKPageRef page, WKNativeEventPtr event, const void *clientInfo);
 typedef bool (*WKPageGetToolbarsAreVisibleCallback)(WKPageRef page, const void *clientInfo);
 typedef void (*WKPageSetToolbarsAreVisibleCallback)(WKPageRef page, bool toolbarsVisible, const void *clientInfo);
@@ -187,6 +188,7 @@ struct WKPageUIClient {
     WKPageRunJavaScriptPromptCallback                                   runJavaScriptPrompt;
     WKPageSetStatusTextCallback                                         setStatusText;
     WKPageMouseDidMoveOverElementCallback                               mouseDidMoveOverElement;
+    WKPageMissingPluginButtonClickedCallback                            missingPluginButtonClicked;
     WKPageDidNotHandleKeyEventCallback                                  didNotHandleKeyEvent;
     WKPageGetToolbarsAreVisibleCallback                                 toolbarsAreVisible;
     WKPageSetToolbarsAreVisibleCallback                                 setToolbarsAreVisible;
index 621d966..4b526a0 100644 (file)
@@ -341,6 +341,7 @@ QWKPage::QWKPage(QWKContext* context)
         0,  /* runJavaScriptPrompt */
         0,  /* setStatusText */
         0,  /* mouseDidMoveOverElement */
+        0,  /* missingPluginButtonClicked */
         0,  /* didNotHandleKeyEvent */
         0,  /* toolbarsAreVisible */
         0,  /* setToolbarsAreVisible */
index c3019af..bef2e2d 100644 (file)
@@ -1263,7 +1263,6 @@ void WebPageProxy::setStatusText(const String& text)
 
 void WebPageProxy::mouseDidMoveOverElement(uint32_t opaqueModifiers, CoreIPC::ArgumentDecoder* arguments)
 {
-
     RefPtr<APIObject> userData;
     WebContextUserMessageDecoder messageDecoder(userData, context());
     if (!arguments->decode(messageDecoder))
@@ -1274,6 +1273,11 @@ void WebPageProxy::mouseDidMoveOverElement(uint32_t opaqueModifiers, CoreIPC::Ar
     m_uiClient.mouseDidMoveOverElement(this, modifiers, userData.get());
 }
 
+void WebPageProxy::missingPluginButtonClicked(const String& mimeType, const String& url)
+{
+    m_uiClient.missingPluginButtonClicked(this, mimeType, url);
+}
+
 void WebPageProxy::setToolbarsAreVisible(bool toolbarsAreVisible)
 {
     m_uiClient.setToolbarsAreVisible(this, toolbarsAreVisible);
index ce3ffeb..49866cf 100644 (file)
@@ -357,6 +357,7 @@ private:
     void runJavaScriptPrompt(uint64_t frameID, const String&, const String&, String& result);
     void setStatusText(const String&);
     void mouseDidMoveOverElement(uint32_t modifiers, CoreIPC::ArgumentDecoder*);
+    void missingPluginButtonClicked(const String& mimeType, const String& url);
     void setToolbarsAreVisible(bool toolbarsAreVisible);
     void getToolbarsAreVisible(bool& toolbarsAreVisible);
     void setMenuBarIsVisible(bool menuBarIsVisible);
index b332543..6168123 100644 (file)
@@ -29,6 +29,7 @@ messages -> WebPageProxy {
     RunJavaScriptConfirm(uint64_t frameID, WTF::String message) -> (bool result)
     RunJavaScriptPrompt(uint64_t frameID, WTF::String message, WTF::String defaultValue) -> (WTF::String result)
     MouseDidMoveOverElement(uint32_t modifiers, WebKit::InjectedBundleUserMessageEncoder userData);
+    MissingPluginButtonClicked(WTF::String mimeType, WTF::String url)
     DidChangeViewportData(WebCore::ViewportArguments arguments)
     DidReceiveEvent(uint32_t type, bool handled)
     DidValidateMenuItem(WTF::String commandName, bool isEnabled, int32_t state)
index 36fafae..89c3b5e 100644 (file)
@@ -130,6 +130,14 @@ void WebUIClient::mouseDidMoveOverElement(WebPageProxy* page, WebEvent::Modifier
     m_client.mouseDidMoveOverElement(toAPI(page), toAPI(modifiers), toAPI(userData), m_client.clientInfo);
 }
 
+void WebUIClient::missingPluginButtonClicked(WebPageProxy* page, const String& mimeType, const String& url)
+{
+    if (!m_client.missingPluginButtonClicked)
+        return;
+
+    m_client.missingPluginButtonClicked(toAPI(page), toAPI(mimeType.impl()), toAPI(url.impl()), m_client.clientInfo);
+}
+
 void WebUIClient::didNotHandleKeyEvent(WebPageProxy* page, const NativeWebKeyboardEvent& event)
 {
     if (!m_client.didNotHandleKeyEvent)
index 477a81c..909a63c 100644 (file)
@@ -60,7 +60,7 @@ public:
 
     void setStatusText(WebPageProxy*, const String&);
     void mouseDidMoveOverElement(WebPageProxy*, WebEvent::Modifiers, APIObject*);
-
+    void missingPluginButtonClicked(WebPageProxy*, const String& mimeType, const String& url);
     void didNotHandleKeyEvent(WebPageProxy*, const NativeWebKeyboardEvent&);
 
     bool toolbarsAreVisible(WebPageProxy*);
index a112c55..7446ff7 100644 (file)
 #include <WebCore/FileChooser.h>
 #include <WebCore/Frame.h>
 #include <WebCore/FrameLoader.h>
+#include <WebCore/HTMLNames.h>
+#include <WebCore/HTMLPlugInImageElement.h>
 #include <WebCore/Page.h>
 #include <WebCore/SecurityOrigin.h>
 
 using namespace WebCore;
+using namespace HTMLNames;
 
 namespace WebKit {
 
@@ -389,6 +392,22 @@ void WebChromeClient::scrollRectIntoView(const IntRect&, const ScrollView*) cons
     notImplemented();
 }
 
+bool WebChromeClient::shouldMissingPluginMessageBeButton() const
+{
+    // FIXME: <rdar://problem/8794397> We should only return true when there is a 
+    // missingPluginButtonClicked callback defined on the Page UI client.
+    return true;
+}
+    
+void WebChromeClient::missingPluginButtonClicked(Element* element) const
+{
+    ASSERT(element->hasTagName(objectTag) || element->hasTagName(embedTag));
+
+    HTMLPlugInImageElement* pluginElement = static_cast<HTMLPlugInImageElement*>(element);
+
+    m_page->send(Messages::WebPageProxy::MissingPluginButtonClicked(pluginElement->serviceType(), pluginElement->url()));
+}
+
 void WebChromeClient::scrollbarsModeDidChange() const
 {
     notImplemented();
index 8e97ff2..01678ec 100644 (file)
@@ -117,6 +117,9 @@ private:
     virtual void scrollRectIntoView(const WebCore::IntRect&, const WebCore::ScrollView*) const; // Currently only Mac has a non empty implementation.
     // End methods used by HostWindow.
 
+    virtual bool shouldMissingPluginMessageBeButton() const;
+    virtual void missingPluginButtonClicked(WebCore::Element*) const;
+
     virtual void scrollbarsModeDidChange() const;
     virtual void mouseDidMoveOverElement(const WebCore::HitTestResult&, unsigned modifierFlags);