Title: [87335] trunk/Source
Revision
87335
Author
mr...@apple.com
Date
2011-05-25 16:41:07 -0700 (Wed, 25 May 2011)

Log Message

<rdar://problem/9504058> Need some way to query user gesture state from injected bundle

Reviewed by Sam Weinig.

Source/WebCore:

* WebCore.exp.in: Add an export that WebKit2 needs.

Source/WebKit2:

Add WKBundleIsProcessingUserGesture.

* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundleIsPageBoxVisible):
(WKBundleIsProcessingUserGesture):
* WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::isProcessingUserGesture):
* WebProcess/InjectedBundle/InjectedBundle.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (87334 => 87335)


--- trunk/Source/WebCore/ChangeLog	2011-05-25 23:39:48 UTC (rev 87334)
+++ trunk/Source/WebCore/ChangeLog	2011-05-25 23:41:07 UTC (rev 87335)
@@ -1,3 +1,11 @@
+2011-05-25  Mark Rowe  <mr...@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        <rdar://problem/9504058> Need some way to query user gesture state from injected bundle
+
+        * WebCore.exp.in: Add an export that WebKit2 needs.
+
 2011-05-25  Jer Noble  <jer.no...@apple.com>
 
         Ureviewed; Build fix for Leopard and Snow Leopard.

Modified: trunk/Source/WebCore/WebCore.exp.in (87334 => 87335)


--- trunk/Source/WebCore/WebCore.exp.in	2011-05-25 23:39:48 UTC (rev 87334)
+++ trunk/Source/WebCore/WebCore.exp.in	2011-05-25 23:41:07 UTC (rev 87335)
@@ -540,6 +540,7 @@
 __ZN7WebCore20ResourceResponseBase24setExpectedContentLengthEx
 __ZN7WebCore20ResourceResponseBaseC2Ev
 __ZN7WebCore20SpaceSplitStringData12createVectorEv
+__ZN7WebCore20UserGestureIndicator23s_processingUserGestureE
 __ZN7WebCore20UserGestureIndicatorC1ENS_26ProcessingUserGestureStateE
 __ZN7WebCore20UserGestureIndicatorD1Ev
 __ZN7WebCore20makeRGBA32FromFloatsEffff

Modified: trunk/Source/WebKit2/ChangeLog (87334 => 87335)


--- trunk/Source/WebKit2/ChangeLog	2011-05-25 23:39:48 UTC (rev 87334)
+++ trunk/Source/WebKit2/ChangeLog	2011-05-25 23:41:07 UTC (rev 87335)
@@ -1,3 +1,19 @@
+2011-05-25  Mark Rowe  <mr...@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        <rdar://problem/9504058> Need some way to query user gesture state from injected bundle
+
+        Add WKBundleIsProcessingUserGesture.
+
+        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
+        (WKBundleIsPageBoxVisible):
+        (WKBundleIsProcessingUserGesture):
+        * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::isProcessingUserGesture):
+        * WebProcess/InjectedBundle/InjectedBundle.h:
+
 2011-05-24  Jer Noble  <jer.no...@apple.com>
 
         Reviewed by Darin Adler.

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp (87334 => 87335)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp	2011-05-25 23:39:48 UTC (rev 87334)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp	2011-05-25 23:41:07 UTC (rev 87335)
@@ -193,7 +193,12 @@
     return toCopiedAPI(toImpl(bundleRef)->pageSizeAndMarginsInPixels(toImpl(frameRef), pageIndex, width, height, marginTop, marginRight, marginBottom, marginLeft));
 }
 
-WK_EXPORT bool WKBundleIsPageBoxVisible(WKBundleRef bundleRef, WKBundleFrameRef frameRef, int pageIndex)
+bool WKBundleIsPageBoxVisible(WKBundleRef bundleRef, WKBundleFrameRef frameRef, int pageIndex)
 {
     return toImpl(bundleRef)->isPageBoxVisible(toImpl(frameRef), pageIndex);
 }
+
+bool WKBundleIsProcessingUserGesture(WKBundleRef)
+{
+    return InjectedBundle::isProcessingUserGesture();
+}

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h (87334 => 87335)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h	2011-05-25 23:39:48 UTC (rev 87334)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h	2011-05-25 23:41:07 UTC (rev 87335)
@@ -79,6 +79,8 @@
 WK_EXPORT void WKBundleRemoveOriginAccessWhitelistEntry(WKBundleRef bundle, WKStringRef, WKStringRef, WKStringRef, bool);
 WK_EXPORT void WKBundleResetOriginAccessWhitelists(WKBundleRef bundle);
 
+WK_EXPORT bool WKBundleIsProcessingUserGesture(WKBundleRef bundle);
+
 #ifdef __cplusplus
 }
 #endif

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp (87334 => 87335)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp	2011-05-25 23:39:48 UTC (rev 87334)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp	2011-05-25 23:41:07 UTC (rev 87335)
@@ -51,6 +51,7 @@
 #include <WebCore/PrintContext.h>
 #include <WebCore/SecurityOrigin.h>
 #include <WebCore/Settings.h>
+#include <WebCore/UserGestureIndicator.h>
 #include <wtf/OwnArrayPtr.h>
 #include <wtf/PassOwnArrayPtr.h>
 
@@ -216,6 +217,11 @@
     return PrintContext::isPageBoxVisible(coreFrame, pageIndex);
 }
 
+bool InjectedBundle::isProcessingUserGesture()
+{
+    return UserGestureIndicator::getUserGestureState() == DefinitelyProcessingUserGesture;
+}
+
 static PassOwnPtr<Vector<String> > toStringVector(ImmutableArray* patterns)
 {
     if (!patterns)

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h (87334 => 87335)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h	2011-05-25 23:39:48 UTC (rev 87334)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h	2011-05-25 23:41:07 UTC (rev 87335)
@@ -131,6 +131,8 @@
 
     static void reportException(JSContextRef, JSValueRef exception);
 
+    static bool isProcessingUserGesture();
+
 private:
     InjectedBundle(const String&);
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to