Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1248)

Unified Diff: Source/core/inspector/InspectorPageAgent.cpp

Issue 1180843006: [DevTools] Add dialog type and return value to Page.javascriptDialog{Opening,Closed}. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: frontend Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/inspector/InspectorPageAgent.h ('k') | Source/core/loader/EmptyClients.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorPageAgent.cpp
diff --git a/Source/core/inspector/InspectorPageAgent.cpp b/Source/core/inspector/InspectorPageAgent.cpp
index 0ce2bdb473217c2018db058ecd191dd6fec18111..1858ef4c973259847183241f5b99f73d31c2cdd4 100644
--- a/Source/core/inspector/InspectorPageAgent.cpp
+++ b/Source/core/inspector/InspectorPageAgent.cpp
@@ -96,6 +96,21 @@ String frameId(LocalFrame* frame)
return frame ? InspectorIdentifiers<LocalFrame>::identifier(frame) : "";
}
+TypeBuilder::Page::DialogType::Enum dialogTypeToProtocol(ChromeClient::DialogType dialogType)
+{
+ switch (dialogType) {
+ case ChromeClient::AlertDialog:
+ return TypeBuilder::Page::DialogType::Alert;
+ case ChromeClient::ConfirmDialog:
+ return TypeBuilder::Page::DialogType::Confirm;
+ case ChromeClient::PromptDialog:
+ return TypeBuilder::Page::DialogType::Prompt;
+ case ChromeClient::HTMLDialog:
+ return TypeBuilder::Page::DialogType::Beforeunload;
+ }
+ return TypeBuilder::Page::DialogType::Alert;
+}
+
}
class InspectorPageAgent::GetResourceContentLoadListener final : public VoidCallback {
@@ -743,14 +758,14 @@ void InspectorPageAgent::frameClearedScheduledNavigation(LocalFrame* frame)
frontend()->frameClearedScheduledNavigation(frameId(frame));
}
-void InspectorPageAgent::willRunJavaScriptDialog(const String& message)
+void InspectorPageAgent::willRunJavaScriptDialog(const String& message, ChromeClient::DialogType dialogType)
{
- frontend()->javascriptDialogOpening(message);
+ frontend()->javascriptDialogOpening(message, dialogTypeToProtocol(dialogType));
}
-void InspectorPageAgent::didRunJavaScriptDialog()
+void InspectorPageAgent::didRunJavaScriptDialog(bool result)
{
- frontend()->javascriptDialogClosed();
+ frontend()->javascriptDialogClosed(result);
}
void InspectorPageAgent::didLayout()
« no previous file with comments | « Source/core/inspector/InspectorPageAgent.h ('k') | Source/core/loader/EmptyClients.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698