[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

sfalken at apple.com sfalken at apple.com
Thu Apr 8 01:03:49 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 817a96a01a26096ad6928aa4d57b34bda3d4215a
Author: sfalken at apple.com <sfalken at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jan 13 21:35:40 2010 +0000

    Add additional Geolocation interfaces in WebKit for Windows.
    
    Reviewed by Adam Roben.
    
    * Interfaces/IWebGeolocationPolicyListener.idl: Added.
    * Interfaces/IWebUIDelegatePrivate.idl: Add decidePolicyForGeolocationRequest to IWebUIDelegatePrivate2.
    Append since this version hasn't shipped.
    * Interfaces/WebKit.idl: Add include of IWebGeolocationPolicyListener.idl.
    * WebCoreSupport/WebChromeClient.cpp:
    (WebChromeClient::requestGeolocationPermissionForFrame): Call into decidePolicyForGeolocationRequest.
    * WebCoreSupport/WebGeolocationControllerClient.cpp:
    (WebGeolocationControllerClient::WebGeolocationControllerClient): Moved *.
    * WebGeolocationPolicyListener.cpp: Added.
    * WebGeolocationPolicyListener.h: Added.
    * WebKit.vcproj/Interfaces.vcproj: Added IWebGeolocationPolicyListener.
    * WebKit.vcproj/WebKit.vcproj: Added WebGeolocationPolicyListener, WebGeolocationPolicyListener.
    * WebView.cpp:
    (WebView::setGeolocationProvider): Removed extraneous STDMETHODCALLTYPE.
    (WebView::geolocationProvider): Removed extraneous STDMETHODCALLTYPE.
    (WebView::geolocationDidChangePosition): Removed extraneous STDMETHODCALLTYPE.
    (WebView::geolocationDidFailWithError): Removed extraneous STDMETHODCALLTYPE.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53202 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index 723c1ea..8e19b80 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,3 +1,27 @@
+2010-01-13  Steve Falkenburg  <sfalken at apple.com>
+
+        Reviewed by Adam Roben.
+
+        Add additional Geolocation interfaces in WebKit for Windows.
+
+        * Interfaces/IWebGeolocationPolicyListener.idl: Added.
+        * Interfaces/IWebUIDelegatePrivate.idl: Add decidePolicyForGeolocationRequest to IWebUIDelegatePrivate2.
+        Append since this version hasn't shipped.
+        * Interfaces/WebKit.idl: Add include of IWebGeolocationPolicyListener.idl.
+        * WebCoreSupport/WebChromeClient.cpp:
+        (WebChromeClient::requestGeolocationPermissionForFrame): Call into decidePolicyForGeolocationRequest.
+        * WebCoreSupport/WebGeolocationControllerClient.cpp:
+        (WebGeolocationControllerClient::WebGeolocationControllerClient): Moved *.
+        * WebGeolocationPolicyListener.cpp: Added.
+        * WebGeolocationPolicyListener.h: Added.
+        * WebKit.vcproj/Interfaces.vcproj: Added IWebGeolocationPolicyListener.
+        * WebKit.vcproj/WebKit.vcproj: Added WebGeolocationPolicyListener, WebGeolocationPolicyListener.
+        * WebView.cpp:
+        (WebView::setGeolocationProvider): Removed extraneous STDMETHODCALLTYPE.
+        (WebView::geolocationProvider): Removed extraneous STDMETHODCALLTYPE.
+        (WebView::geolocationDidChangePosition): Removed extraneous STDMETHODCALLTYPE.
+        (WebView::geolocationDidFailWithError): Removed extraneous STDMETHODCALLTYPE.
+
 2010-01-12  Steve Falkenburg  <sfalken at apple.com>
 
         Reviewed by Adam Roben, Sam Weinig.
diff --git a/WebKit/win/Interfaces/IWebGeolocationPolicyListener.idl b/WebKit/win/Interfaces/IWebGeolocationPolicyListener.idl
new file mode 100644
index 0000000..54b00bd
--- /dev/null
+++ b/WebKit/win/Interfaces/IWebGeolocationPolicyListener.idl
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef DO_NO_IMPORTS
+import "oaidl.idl";
+import "ocidl.idl";
+#endif
+
+[
+    object,
+    oleautomation,
+    uuid(1300A76E-26DF-4BED-B79F-3930D7A4202F),
+    pointer_default(unique)
+]
+interface IWebGeolocationPolicyListener : IUnknown
+{
+    HRESULT allow();
+    HRESULT deny();
+}
diff --git a/WebKit/win/Interfaces/IWebUIDelegatePrivate.idl b/WebKit/win/Interfaces/IWebUIDelegatePrivate.idl
index e09aac4..ce00430 100644
--- a/WebKit/win/Interfaces/IWebUIDelegatePrivate.idl
+++ b/WebKit/win/Interfaces/IWebUIDelegatePrivate.idl
@@ -26,6 +26,7 @@
 #ifndef DO_NO_IMPORTS
 import "oaidl.idl";
 import "ocidl.idl";
+import "IWebGeolocationPolicyListener.idl";
 import "IWebSecurityOrigin.idl";
 import "IWebView.idl";
 #endif
@@ -37,6 +38,7 @@ cpp_quote("#define WebEmbeddedViewMIMETypeKey TEXT(\"WebEmbeddedViewMIMETypeKey\
 
 interface IWebEmbeddedView;
 interface IWebFrame;
+interface IWebGeolocationPolicyListener;
 interface IWebSecurityOrigin;
 interface IWebView;
 
@@ -94,4 +96,6 @@ interface IWebUIDelegatePrivate2 : IWebUIDelegatePrivate
     HRESULT createWebViewWithRequest([in] IWebView* sender, [in] IWebURLRequest* request, [in] IPropertyBag* windowFeatures, [out, retval] IWebView** newWebView);
 
     HRESULT drawBackground([in] IWebView* sender, [in] OLE_HANDLE hdc, [in] const RECT* dirtyRect);
+
+    HRESULT decidePolicyForGeolocationRequest([in] IWebView* sender, [in] IWebFrame* frame, [in] IWebSecurityOrigin* origin, [in] IWebGeolocationPolicyListener* listener);
 }
diff --git a/WebKit/win/Interfaces/WebKit.idl b/WebKit/win/Interfaces/WebKit.idl
index dabb2d7..1d8ff7d 100644
--- a/WebKit/win/Interfaces/WebKit.idl
+++ b/WebKit/win/Interfaces/WebKit.idl
@@ -88,6 +88,7 @@ import "ocidl.idl";
 #include "IWebFrameLoadDelegatePrivate2.idl"
 #include "IWebFramePrivate.idl"
 #include "IWebFrameView.idl"
+#include "IWebGeolocationPolicyListener.idl"
 #include "IWebGeolocationPosition.idl"
 #include "IWebGeolocationProvider.idl"
 #include "IWebHTMLRepresentation.idl"
diff --git a/WebKit/win/WebCoreSupport/WebChromeClient.cpp b/WebKit/win/WebCoreSupport/WebChromeClient.cpp
index 002a629..a1bb3a8 100644
--- a/WebKit/win/WebCoreSupport/WebChromeClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebChromeClient.cpp
@@ -30,6 +30,7 @@
 #include "COMVariantSetter.h"
 #include "WebElementPropertyBag.h"
 #include "WebFrame.h"
+#include "WebGeolocationPolicyListener.h"
 #include "WebHistory.h"
 #include "WebMutableURLRequest.h"
 #include "WebDesktopNotificationsDelegate.h"
@@ -44,6 +45,7 @@
 #include <WebCore/FloatRect.h>
 #include <WebCore/FrameLoadRequest.h>
 #include <WebCore/FrameView.h>
+#include <WebCore/Geolocation.h>
 #include <WebCore/HTMLNames.h>
 #include <WebCore/LocalizedStrings.h>
 #include <WebCore/NotImplemented.h>
@@ -749,10 +751,27 @@ bool WebChromeClient::setCursor(PlatformCursorHandle cursor)
     return true;
 }
 
-void WebChromeClient::requestGeolocationPermissionForFrame(Frame*, Geolocation*)
+void WebChromeClient::requestGeolocationPermissionForFrame(Frame* frame, Geolocation* geolocation)
 {
-    // See the comment in WebCore/page/ChromeClient.h
-    notImplemented();
+    COMPtr<IWebUIDelegate> uiDelegate;
+    if (FAILED(m_webView->uiDelegate(&uiDelegate))) {
+        geolocation->setIsAllowed(false);
+        return;
+    }
+
+    COMPtr<IWebUIDelegatePrivate2> uiDelegatePrivate2(Query, uiDelegate);
+    if (!uiDelegatePrivate2) {
+        geolocation->setIsAllowed(false);
+        return;
+    }
+
+    COMPtr<WebSecurityOrigin> origin(AdoptCOM, WebSecurityOrigin::createInstance(frame->document()->securityOrigin()));
+    COMPtr<WebGeolocationPolicyListener> listener = WebGeolocationPolicyListener::createInstance(geolocation);
+    HRESULT hr = uiDelegatePrivate2->decidePolicyForGeolocationRequest(m_webView, kit(frame), origin.get(), listener.get());
+    if (hr != E_NOTIMPL)
+        return;
+
+    geolocation->setIsAllowed(false);
 }
 
 #if USE(ACCELERATED_COMPOSITING)
diff --git a/WebKit/win/WebCoreSupport/WebGeolocationControllerClient.cpp b/WebKit/win/WebCoreSupport/WebGeolocationControllerClient.cpp
index c3450a0..ed98434 100644
--- a/WebKit/win/WebCoreSupport/WebGeolocationControllerClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebGeolocationControllerClient.cpp
@@ -32,7 +32,7 @@
 
 using namespace WebCore;
 
-WebGeolocationControllerClient::WebGeolocationControllerClient(WebView *webView)
+WebGeolocationControllerClient::WebGeolocationControllerClient(WebView* webView)
     : m_webView(webView)
 {
 }
diff --git a/WebKit/win/WebGeolocationPolicyListener.cpp b/WebKit/win/WebGeolocationPolicyListener.cpp
new file mode 100644
index 0000000..d16f892
--- /dev/null
+++ b/WebKit/win/WebGeolocationPolicyListener.cpp
@@ -0,0 +1,97 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include "config.h"
+#include "WebKitDLL.h"
+#include "WebGeolocationPolicyListener.h"
+
+#include <WebCore/Geolocation.h>
+
+using namespace WebCore;
+
+// WebGeolocationPolicyListener ----------------------------------------------------------------
+
+COMPtr<WebGeolocationPolicyListener> WebGeolocationPolicyListener::createInstance(PassRefPtr<Geolocation> geolocation)
+{
+    return new WebGeolocationPolicyListener(geolocation);
+}
+
+WebGeolocationPolicyListener::WebGeolocationPolicyListener(PassRefPtr<Geolocation> geolocation)
+    : m_refCount(0)
+    , m_geolocation(geolocation)
+{
+    gClassCount++;
+    gClassNameCount.add("WebGeolocationPolicyListener");
+}
+
+WebGeolocationPolicyListener::~WebGeolocationPolicyListener()
+{
+    gClassCount--;
+    gClassNameCount.remove("WebGeolocationPolicyListener");
+}
+
+// IUnknown -------------------------------------------------------------------
+
+HRESULT STDMETHODCALLTYPE WebGeolocationPolicyListener::QueryInterface(REFIID riid, void** ppvObject)
+{
+    *ppvObject = 0;
+    if (IsEqualIID(riid, __uuidof(IUnknown)))
+        *ppvObject = static_cast<IWebGeolocationPolicyListener*>(this);
+    else if (IsEqualIID(riid, __uuidof(IWebGeolocationPolicyListener)))
+        *ppvObject = static_cast<IWebGeolocationPolicyListener*>(this);
+    else
+        return E_NOINTERFACE;
+
+    AddRef();
+    return S_OK;
+}
+
+ULONG STDMETHODCALLTYPE WebGeolocationPolicyListener::AddRef()
+{
+    return ++m_refCount;
+}
+
+ULONG STDMETHODCALLTYPE WebGeolocationPolicyListener::Release()
+{
+    ULONG newRef = --m_refCount;
+    if (!newRef)
+        delete this;
+
+    return newRef;
+}
+
+// IWebPolicyDecisionListener ------------------------------------------------------------
+
+HRESULT STDMETHODCALLTYPE WebGeolocationPolicyListener::allow()
+{
+    m_geolocation->setIsAllowed(true);
+    return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE WebGeolocationPolicyListener::deny()
+{
+    m_geolocation->setIsAllowed(false);
+    return S_OK;
+}
diff --git a/WebKit/win/WebGeolocationPolicyListener.h b/WebKit/win/WebGeolocationPolicyListener.h
new file mode 100644
index 0000000..636c5f5
--- /dev/null
+++ b/WebKit/win/WebGeolocationPolicyListener.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef WebGeolocationPolicyListener_h
+#define WebGeolocationPolicyListener_h
+
+#include "WebKit.h"
+
+#include <WebCore/COMPtr.h>
+
+#include <WTF/PassRefPtr.h>
+#include <WTF/RefPtr.h>
+
+namespace WebCore {
+    class Geolocation;
+}
+
+class WebGeolocationPolicyListener : public IWebGeolocationPolicyListener {
+public:
+    static COMPtr<WebGeolocationPolicyListener> createInstance(PassRefPtr<WebCore::Geolocation>);
+
+    // IUnknown
+    virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject);
+    virtual ULONG STDMETHODCALLTYPE AddRef();
+    virtual ULONG STDMETHODCALLTYPE Release();
+
+    // IWebGeolocationPolicyListener
+    virtual HRESULT STDMETHODCALLTYPE allow();
+    virtual HRESULT STDMETHODCALLTYPE deny();
+
+private:
+    WebGeolocationPolicyListener(PassRefPtr<WebCore::Geolocation>);
+    ~WebGeolocationPolicyListener();
+
+    ULONG m_refCount;
+    RefPtr<WebCore::Geolocation> m_geolocation;
+};
+
+#endif WebGeolocationPolicyListener_h
diff --git a/WebKit/win/WebKit.vcproj/Interfaces.vcproj b/WebKit/win/WebKit.vcproj/Interfaces.vcproj
index 299d652..acd44c5 100644
--- a/WebKit/win/WebKit.vcproj/Interfaces.vcproj
+++ b/WebKit/win/WebKit.vcproj/Interfaces.vcproj
@@ -764,6 +764,26 @@
 			</FileConfiguration>
 		</File>
 		<File
+			RelativePath="..\Interfaces\IWebGeolocationPolicyListener.idl"
+			>
+			<FileConfiguration
+				Name="Debug|Win32"
+				ExcludedFromBuild="true"
+				>
+				<Tool
+					Name="VCMIDLTool"
+				/>
+			</FileConfiguration>
+			<FileConfiguration
+				Name="Release|Win32"
+				ExcludedFromBuild="true"
+				>
+				<Tool
+					Name="VCMIDLTool"
+				/>
+			</FileConfiguration>
+		</File>
+		<File
 			RelativePath="..\Interfaces\IWebGeolocationPosition.idl"
 			>
 			<FileConfiguration
diff --git a/WebKit/win/WebKit.vcproj/WebKit.vcproj b/WebKit/win/WebKit.vcproj/WebKit.vcproj
index be3710e..4effb73 100644
--- a/WebKit/win/WebKit.vcproj/WebKit.vcproj
+++ b/WebKit/win/WebKit.vcproj/WebKit.vcproj
@@ -666,6 +666,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\WebGeolocationPolicyListener.h"
+				>
+			</File>
+			<File
 				RelativePath="..\WebGeolocationPosition.h"
 				>
 			</File>
@@ -1082,6 +1086,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\WebGeolocationPolicyListener.cpp"
+				>
+			</File>
+			<File
 				RelativePath="..\WebGeolocationPosition.cpp"
 				>
 			</File>
diff --git a/WebKit/win/WebView.cpp b/WebKit/win/WebView.cpp
index ff78f22..0cb0cd7 100644
--- a/WebKit/win/WebView.cpp
+++ b/WebKit/win/WebView.cpp
@@ -6075,13 +6075,13 @@ HRESULT WebView::hasPluginForNodeBeenHalted(IDOMNode* domNode, BOOL* result)
     return S_OK;
 }
 
-HRESULT STDMETHODCALLTYPE WebView::setGeolocationProvider(IWebGeolocationProvider* locationProvider)
+HRESULT WebView::setGeolocationProvider(IWebGeolocationProvider* locationProvider)
 {
     m_geolocationProvider = locationProvider;
     return S_OK;
 }
 
-HRESULT STDMETHODCALLTYPE WebView::geolocationProvider(IWebGeolocationProvider** locationProvider)
+HRESULT WebView::geolocationProvider(IWebGeolocationProvider** locationProvider)
 {
     if (!locationProvider)
         return E_POINTER;
@@ -6092,7 +6092,7 @@ HRESULT STDMETHODCALLTYPE WebView::geolocationProvider(IWebGeolocationProvider**
     return m_geolocationProvider.copyRefTo(locationProvider);
 }
 
-HRESULT STDMETHODCALLTYPE WebView::geolocationDidChangePosition(IWebGeolocationPosition* position)
+HRESULT WebView::geolocationDidChangePosition(IWebGeolocationPosition* position)
 {
 #if ENABLE(CLIENT_BASED_GEOLOCATION)
     if (!m_page)
@@ -6104,7 +6104,7 @@ HRESULT STDMETHODCALLTYPE WebView::geolocationDidChangePosition(IWebGeolocationP
 #endif
 }
 
-HRESULT STDMETHODCALLTYPE WebView::geolocationDidFailWithError(IWebError* error)
+HRESULT WebView::geolocationDidFailWithError(IWebError* error)
 {
 #if ENABLE(CLIENT_BASED_GEOLOCATION)
     if (!m_page)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list