Web Inspector: Add support for handling modal dialogs
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Feb 2013 08:50:19 +0000 (08:50 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Feb 2013 08:50:19 +0000 (08:50 +0000)
commit923a218aedee6883cb683c6dcae73eb3d258485d
treef48dc73f7143c3a7d7e35545adb3ebfe1b4774fc
parent470f714ea46a133d7eddd261f722e8a204bd9982
Web Inspector: Add support for handling modal dialogs
https://bugs.webkit.org/show_bug.cgi?id=107883

Patch by Ken Kania <kkania@chromium.org> on 2013-02-01
Reviewed by Pavel Feldman.

Introduce support for being notified when a JavaScript modal dialog
is opening and closing, as well as a new command for accepting or
dismissing the dialog.

Source/WebCore:

Test: inspector-protocol/page/willRunJavaScriptDialog.html

* inspector/Inspector.json:
* inspector/InspectorClient.h:
(WebCore::InspectorClient::handleJavaScriptDialog):
(InspectorClient):
* inspector/InspectorInstrumentation.cpp:
(WebCore):
(WebCore::InspectorInstrumentation::willRunJavaScriptDialogImpl):
(WebCore::InspectorInstrumentation::didRunJavaScriptDialogImpl):
* inspector/InspectorInstrumentation.h:
(InspectorInstrumentation):
(WebCore::InspectorInstrumentation::willRunJavaScriptDialog):
(WebCore):
(WebCore::InspectorInstrumentation::didRunJavaScriptDialog):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::willRunJavaScriptDialog):
(WebCore):
(WebCore::InspectorPageAgent::didRunJavaScriptDialog):
(WebCore::InspectorPageAgent::handleJavaScriptDialog):
* inspector/InspectorPageAgent.h:
* inspector/front-end/ResourceTreeModel.js:
(WebInspector.PageDispatcher.prototype.frameStartedLoading):
(WebInspector.PageDispatcher.prototype.frameStoppedLoading):
(WebInspector.PageDispatcher.prototype.frameScheduledNavigation):
(WebInspector.PageDispatcher.prototype.frameClearedScheduledNavigation):
(WebInspector.PageDispatcher.prototype.javascriptDialogOpening):
(WebInspector.PageDispatcher.prototype.javascriptDialogClosed):
* page/Chrome.cpp:
(WebCore::Chrome::runBeforeUnloadConfirmPanel):
(WebCore::Chrome::runJavaScriptAlert):
(WebCore::Chrome::runJavaScriptConfirm):
(WebCore::Chrome::runJavaScriptPrompt):

Source/WebKit/chromium:

* public/WebDevToolsAgent.h:
* src/InspectorClientImpl.cpp:
(WebKit::InspectorClientImpl::handleJavaScriptDialog):
(WebKit):
* src/InspectorClientImpl.h:
(InspectorClientImpl):
* src/WebDevToolsAgentImpl.cpp:
(BrowserDataHintStringValues):
(WebKit::WebDevToolsAgentImpl::captureScreenshot):
(WebKit::WebDevToolsAgentImpl::handleJavaScriptDialog):
(WebKit):
(WebKit::browserHintToString):
(WebKit::browserHintFromString):
(WebKit::WebDevToolsAgent::patchWithBrowserData):
* src/WebDevToolsAgentImpl.h:
(WebDevToolsAgentImpl):

LayoutTests:

* inspector-protocol/page/javascriptDialogEvents-expected.txt: Added.
* inspector-protocol/page/javascriptDialogEvents.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@141555 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
LayoutTests/ChangeLog
LayoutTests/inspector-protocol/page/javascriptDialogEvents-expected.txt [new file with mode: 0644]
LayoutTests/inspector-protocol/page/javascriptDialogEvents.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/inspector/Inspector.json
Source/WebCore/inspector/InspectorClient.h
Source/WebCore/inspector/InspectorInstrumentation.cpp
Source/WebCore/inspector/InspectorInstrumentation.h
Source/WebCore/inspector/InspectorPageAgent.cpp
Source/WebCore/inspector/InspectorPageAgent.h
Source/WebCore/inspector/front-end/ResourceTreeModel.js
Source/WebCore/page/Chrome.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebDevToolsAgent.h
Source/WebKit/chromium/src/InspectorClientImpl.cpp
Source/WebKit/chromium/src/InspectorClientImpl.h
Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp
Source/WebKit/chromium/src/WebDevToolsAgentImpl.h