Added InspectorController.isWindowVisible to the JavaScript class
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Jul 2008 02:47:45 +0000 (02:47 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Jul 2008 02:47:45 +0000 (02:47 +0000)
        for use in an upcoming change. This will allow the Inspector to not
        perform selective actions while the window is hidden.

        Reviewed by Adam Roben.

        * page/InspectorController.cpp:
        (WebCore::isWindowVisible): Call InspectorController::windowVisible.
        (WebCore::InspectorController::windowScriptObjectAvailable): Add
        the isWindowVisible function to the JavaScript class.

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

WebCore/ChangeLog
WebCore/page/InspectorController.cpp

index ad0623c..1c02f1b 100644 (file)
@@ -1,5 +1,18 @@
 2008-07-21  Timothy Hatcher  <timothy@apple.com>
 
+        Added InspectorController.isWindowVisible to the JavaScript class
+        for use in an upcoming change. This will allow the Inspector to not
+        perform selective actions while the window is hidden.
+
+        Reviewed by Adam Roben.
+
+        * page/InspectorController.cpp:
+        (WebCore::isWindowVisible): Call InspectorController::windowVisible.
+        (WebCore::InspectorController::windowScriptObjectAvailable): Add
+        the isWindowVisible function to the JavaScript class.
+
+2008-07-21  Timothy Hatcher  <timothy@apple.com>
+
         Added TreeOutline.removeChildAtIndex and TreeElement.removeChildAtIndex
         for efficiency of callers that know the index of the child. This
         will be used in an upcoming change.
index b450397..47b908a 100644 (file)
@@ -964,6 +964,14 @@ static JSValueRef removeBreakpoint(JSContextRef ctx, JSObjectRef /*function*/, J
     return JSValueMakeUndefined(ctx);
 }
 
+static JSValueRef isWindowVisible(JSContextRef ctx, JSObjectRef /*function*/, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    InspectorController* controller = reinterpret_cast<InspectorController*>(JSObjectGetPrivate(thisObject));
+    if (!controller)
+        return JSValueMakeUndefined(ctx);
+    return JSValueMakeBoolean(ctx, controller->windowVisible());
+}
+
 // Profiles
 
 static JSValueRef profiles(JSContextRef ctx, JSObjectRef /*function*/, JSObjectRef thisObject, size_t /*argumentCount*/, const JSValueRef[] /*arguments*/, JSValueRef* exception)
@@ -1278,6 +1286,7 @@ void InspectorController::windowScriptObjectAvailable()
         { "stepOutOfFunctionInDebugger", WebCore::stepOutOfFunctionInDebugger, kJSPropertyAttributeNone },
         { "addBreakpoint", WebCore::addBreakpoint, kJSPropertyAttributeNone },
         { "removeBreakpoint", WebCore::removeBreakpoint, kJSPropertyAttributeNone },
+        { "isWindowVisible", WebCore::isWindowVisible, kJSPropertyAttributeNone },
         { 0, 0, 0 }
     };