Title: [292120] trunk/Source
Revision
292120
Author
drou...@apple.com
Date
2022-03-30 13:55:57 -0700 (Wed, 30 Mar 2022)

Log Message

Web Inspector: Sources: the mapped file URL of a Response Local Override should be clickable
https://bugs.webkit.org/show_bug.cgi?id=238533

Reviewed by Patrick Angle.

Source/WebCore:

* inspector/InspectorFrontendHost.h:
* inspector/InspectorFrontendHost.idl:
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::revealFileExternally): Added.
Add a helper for selecting a file in the system file explorer.

* inspector/InspectorFrontendClient.h:
* inspector/InspectorFrontendClientLocal.h:
(WebCore::InspectorFrontendClientLocal::revealFileExternally): Added.
Do nothing in tests (and WK1) as there is no way to check for another app being opened.

Source/WebInspectorUI:

* UserInterface/Views/ResourceContentView.js:
(WI.ResourceContentView.prototype._handleMappedFilePathChanged):
Instead of showing the mapped file path as basic text, linkify it such that it is shown in
the system file explorer when clicked.

* UserInterface/Base/Main.js:
(WI.createMessageTextView):
Allow the `message` to be a `Node` (in addition to a `String`).

Source/WebKit:

* WebProcess/Inspector/RemoteWebInspectorUI.h:
* WebProcess/Inspector/RemoteWebInspectorUI.cpp:
(WebKit::RemoteWebInspectorUI::revealFileExternally): Added.
* WebProcess/Inspector/WebInspectorUI.h:
* WebProcess/Inspector/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::revealFileExternally): Added.
* UIProcess/Inspector/WebInspectorUIProxy.messages.in:
* UIProcess/Inspector/WebInspectorUIProxy.h:
* UIProcess/Inspector/WebInspectorUIProxy.cpp:
(WebKit::WebInspectorUIProxy::revealFileExternally): Added.
(WebKit::WebInspectorUIProxy::platformRevealFileExternally): Added.
* UIProcess/Inspector/gtk/WebInspectorUIProxyGtk.mm:
(WebKit::WebInspectorUIProxy::platformRevealFileExternally): Added.
* UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm:
(WebKit::WebInspectorUIProxy::platformRevealFileExternally): Added.
* UIProcess/Inspector/win/WebInspectorUIProxyWin.mm:
(WebKit::WebInspectorUIProxy::platformRevealFileExternally): Added.
* UIProcess/Inspector/RemoteWebInspectorUIProxy.messages.in:
* UIProcess/Inspector/RemoteWebInspectorUIProxy.h:
* UIProcess/Inspector/RemoteWebInspectorUIProxy.cpp:
(WebKit::RemoteWebInspectorUIProxy::revealFileExternally): Added.
(WebKit::RemoteWebInspectorUIProxy::platformRevealFileExternally): Added.
* UIProcess/Inspector/gtk/RemoteWebInspectorUIProxyGtk.cpp:
(WebKit::RemoteWebInspectorUIProxy::platformRevealFileExternally): Added.
* UIProcess/Inspector/mac/RemoteWebInspectorUIProxyMac.mm:
(WebKit::RemoteWebInspectorUIProxy::platformRevealFileExternally): Added.
* UIProcess/Inspector/win/RemoteWebInspectorUIProxyWin.cpp:
(WebKit::RemoteWebInspectorUIProxy::platformRevealFileExternally): Added.
Add a helper for selecting a file in the system file explorer.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (292119 => 292120)


--- trunk/Source/WebCore/ChangeLog	2022-03-30 20:51:38 UTC (rev 292119)
+++ trunk/Source/WebCore/ChangeLog	2022-03-30 20:55:57 UTC (rev 292120)
@@ -1,3 +1,21 @@
+2022-03-30  Devin Rousso  <drou...@apple.com>
+
+        Web Inspector: Sources: the mapped file URL of a Response Local Override should be clickable
+        https://bugs.webkit.org/show_bug.cgi?id=238533
+
+        Reviewed by Patrick Angle.
+
+        * inspector/InspectorFrontendHost.h:
+        * inspector/InspectorFrontendHost.idl:
+        * inspector/InspectorFrontendHost.cpp:
+        (WebCore::InspectorFrontendHost::revealFileExternally): Added.
+        Add a helper for selecting a file in the system file explorer.
+
+        * inspector/InspectorFrontendClient.h:
+        * inspector/InspectorFrontendClientLocal.h:
+        (WebCore::InspectorFrontendClientLocal::revealFileExternally): Added.
+        Do nothing in tests (and WK1) as there is no way to check for another app being opened.
+
 2022-03-30  Chris Dumez  <cdu...@apple.com>
 
         Optimize the construction of a JSC::Identifier from an ASCIILiteral

Modified: trunk/Source/WebCore/inspector/InspectorFrontendClient.h (292119 => 292120)


--- trunk/Source/WebCore/inspector/InspectorFrontendClient.h	2022-03-30 20:51:38 UTC (rev 292119)
+++ trunk/Source/WebCore/inspector/InspectorFrontendClient.h	2022-03-30 20:55:57 UTC (rev 292120)
@@ -106,6 +106,7 @@
     WEBCORE_EXPORT virtual void changeSheetRect(const FloatRect&) = 0;
 
     WEBCORE_EXPORT virtual void openURLExternally(const String& url) = 0;
+    WEBCORE_EXPORT virtual void revealFileExternally(const String& path) = 0;
     virtual bool canSave() = 0;
     virtual void save(const String& url, const String& content, bool base64Encoded, bool forceSaveAs) = 0;
     virtual void append(const String& url, const String& content) = 0;

Modified: trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.h (292119 => 292120)


--- trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.h	2022-03-30 20:51:38 UTC (rev 292119)
+++ trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.h	2022-03-30 20:55:57 UTC (rev 292120)
@@ -80,6 +80,7 @@
     WEBCORE_EXPORT void changeAttachedWindowWidth(unsigned) final;
     WEBCORE_EXPORT void changeSheetRect(const FloatRect&) final;
     WEBCORE_EXPORT void openURLExternally(const String& url) final;
+    void revealFileExternally(const String&) override { }
     bool canSave()  override { return false; }
     void save(const String&, const String&, bool, bool) override { }
     void append(const String&, const String&) override { }

Modified: trunk/Source/WebCore/inspector/InspectorFrontendHost.cpp (292119 => 292120)


--- trunk/Source/WebCore/inspector/InspectorFrontendHost.cpp	2022-03-30 20:51:38 UTC (rev 292119)
+++ trunk/Source/WebCore/inspector/InspectorFrontendHost.cpp	2022-03-30 20:55:57 UTC (rev 292120)
@@ -444,6 +444,15 @@
         m_client->openURLExternally(url);
 }
 
+void InspectorFrontendHost::revealFileExternally(const String& path)
+{
+    if (!WTF::protocolIs(path, "file"))
+        return;
+
+    if (m_client)
+        m_client->revealFileExternally(path);
+}
+
 bool InspectorFrontendHost::canSave()
 {
     if (m_client)

Modified: trunk/Source/WebCore/inspector/InspectorFrontendHost.h (292119 => 292120)


--- trunk/Source/WebCore/inspector/InspectorFrontendHost.h	2022-03-30 20:51:38 UTC (rev 292119)
+++ trunk/Source/WebCore/inspector/InspectorFrontendHost.h	2022-03-30 20:55:57 UTC (rev 292120)
@@ -108,6 +108,7 @@
     void copyText(const String& text);
     void killText(const String& text, bool shouldPrependToKillRing, bool shouldStartNewSequence);
     void openURLExternally(const String& url);
+    void revealFileExternally(const String& path);
     bool canSave();
     void save(const String& url, const String& content, bool base64Encoded, bool forceSaveAs);
     void append(const String& url, const String& content);

Modified: trunk/Source/WebCore/inspector/InspectorFrontendHost.idl (292119 => 292120)


--- trunk/Source/WebCore/inspector/InspectorFrontendHost.idl	2022-03-30 20:51:38 UTC (rev 292119)
+++ trunk/Source/WebCore/inspector/InspectorFrontendHost.idl	2022-03-30 20:55:57 UTC (rev 292120)
@@ -71,6 +71,7 @@
     undefined copyText(DOMString text);
     undefined killText(DOMString text, boolean shouldPrependToKillRing, boolean shouldStartNewSequence);
     undefined openURLExternally(DOMString url);
+    undefined revealFileExternally(DOMString path);
     boolean canSave();
     undefined save(DOMString url, DOMString content, boolean base64Encoded, boolean forceSaveAs);
     undefined append(DOMString url, DOMString content);

Modified: trunk/Source/WebInspectorUI/ChangeLog (292119 => 292120)


--- trunk/Source/WebInspectorUI/ChangeLog	2022-03-30 20:51:38 UTC (rev 292119)
+++ trunk/Source/WebInspectorUI/ChangeLog	2022-03-30 20:55:57 UTC (rev 292120)
@@ -1,3 +1,19 @@
+2022-03-30  Devin Rousso  <drou...@apple.com>
+
+        Web Inspector: Sources: the mapped file URL of a Response Local Override should be clickable
+        https://bugs.webkit.org/show_bug.cgi?id=238533
+
+        Reviewed by Patrick Angle.
+
+        * UserInterface/Views/ResourceContentView.js:
+        (WI.ResourceContentView.prototype._handleMappedFilePathChanged):
+        Instead of showing the mapped file path as basic text, linkify it such that it is shown in
+        the system file explorer when clicked.
+
+        * UserInterface/Base/Main.js:
+        (WI.createMessageTextView):
+        Allow the `message` to be a `Node` (in addition to a `String`).
+
 2022-03-29  Devin Rousso  <drou...@apple.com>
 
         Web Inspector: Sources: allow Response Local Overrides to map to a file on disk

Modified: trunk/Source/WebInspectorUI/UserInterface/Base/Main.js (292119 => 292120)


--- trunk/Source/WebInspectorUI/UserInterface/Base/Main.js	2022-03-30 20:51:38 UTC (rev 292119)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/Main.js	2022-03-30 20:55:57 UTC (rev 292120)
@@ -3084,7 +3084,7 @@
 
     let textElement = messageElement.appendChild(document.createElement("div"));
     textElement.className = "message";
-    textElement.textContent = message;
+    textElement.append(message);
 
     return messageElement;
 };

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ResourceContentView.js (292119 => 292120)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ResourceContentView.js	2022-03-30 20:51:38 UTC (rev 292119)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ResourceContentView.js	2022-03-30 20:55:57 UTC (rev 292120)
@@ -384,8 +384,24 @@
 
     _handleMappedFilePathChanged(event)
     {
-        this.showMessage(WI.UIString("Mapped to \u201C%s\u201D").format(this.resource.mappedFilePath));
+        let mappedFilePath = this.resource.mappedFilePath;
 
+        let mappedFilePathLink = document.createElement("a");
+        mappedFilePathLink.href = "" + mappedFilePath;
+        mappedFilePathLink.textContent = mappedFilePath;
+        mappedFilePathLink.addEventListener("click", (event) => {
+            event.stop();
+
+            InspectorFrontendHost.revealFileExternally(event.target.href);
+        });
+
+        let fragment = document.createDocumentFragment();
+        String.format(WI.UIString("Mapped to \u201C%s\u201D"), [mappedFilePathLink], String.standardFormatters, fragment, (a, b) => {
+            a.append(b);
+            return a;
+        });
+        this.showMessage(fragment);
+
         if (this._localResourceOverrideBannerView) {
             this.element.insertBefore(this._localResourceOverrideBannerView.element, this.element.firstChild);
             this.addSubview(this._localResourceOverrideBannerView);

Modified: trunk/Source/WebKit/ChangeLog (292119 => 292120)


--- trunk/Source/WebKit/ChangeLog	2022-03-30 20:51:38 UTC (rev 292119)
+++ trunk/Source/WebKit/ChangeLog	2022-03-30 20:55:57 UTC (rev 292120)
@@ -1,3 +1,40 @@
+2022-03-30  Devin Rousso  <drou...@apple.com>
+
+        Web Inspector: Sources: the mapped file URL of a Response Local Override should be clickable
+        https://bugs.webkit.org/show_bug.cgi?id=238533
+
+        Reviewed by Patrick Angle.
+
+        * WebProcess/Inspector/RemoteWebInspectorUI.h:
+        * WebProcess/Inspector/RemoteWebInspectorUI.cpp:
+        (WebKit::RemoteWebInspectorUI::revealFileExternally): Added.
+        * WebProcess/Inspector/WebInspectorUI.h:
+        * WebProcess/Inspector/WebInspectorUI.cpp:
+        (WebKit::WebInspectorUI::revealFileExternally): Added.
+        * UIProcess/Inspector/WebInspectorUIProxy.messages.in:
+        * UIProcess/Inspector/WebInspectorUIProxy.h:
+        * UIProcess/Inspector/WebInspectorUIProxy.cpp:
+        (WebKit::WebInspectorUIProxy::revealFileExternally): Added.
+        (WebKit::WebInspectorUIProxy::platformRevealFileExternally): Added.
+        * UIProcess/Inspector/gtk/WebInspectorUIProxyGtk.mm:
+        (WebKit::WebInspectorUIProxy::platformRevealFileExternally): Added.
+        * UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm:
+        (WebKit::WebInspectorUIProxy::platformRevealFileExternally): Added.
+        * UIProcess/Inspector/win/WebInspectorUIProxyWin.mm:
+        (WebKit::WebInspectorUIProxy::platformRevealFileExternally): Added.
+        * UIProcess/Inspector/RemoteWebInspectorUIProxy.messages.in:
+        * UIProcess/Inspector/RemoteWebInspectorUIProxy.h:
+        * UIProcess/Inspector/RemoteWebInspectorUIProxy.cpp:
+        (WebKit::RemoteWebInspectorUIProxy::revealFileExternally): Added.
+        (WebKit::RemoteWebInspectorUIProxy::platformRevealFileExternally): Added.
+        * UIProcess/Inspector/gtk/RemoteWebInspectorUIProxyGtk.cpp:
+        (WebKit::RemoteWebInspectorUIProxy::platformRevealFileExternally): Added.
+        * UIProcess/Inspector/mac/RemoteWebInspectorUIProxyMac.mm:
+        (WebKit::RemoteWebInspectorUIProxy::platformRevealFileExternally): Added.
+        * UIProcess/Inspector/win/RemoteWebInspectorUIProxyWin.cpp:
+        (WebKit::RemoteWebInspectorUIProxy::platformRevealFileExternally): Added.
+        Add a helper for selecting a file in the system file explorer.
+
 2022-03-30  Sihui Liu  <sihui_...@apple.com>
 
         Avoid initializing default WKWebsiteDataStore in -[WKWebViewConfiguration copyWithZone]

Modified: trunk/Source/WebKit/UIProcess/Inspector/RemoteWebInspectorUIProxy.cpp (292119 => 292120)


--- trunk/Source/WebKit/UIProcess/Inspector/RemoteWebInspectorUIProxy.cpp	2022-03-30 20:51:38 UTC (rev 292119)
+++ trunk/Source/WebKit/UIProcess/Inspector/RemoteWebInspectorUIProxy.cpp	2022-03-30 20:55:57 UTC (rev 292120)
@@ -179,6 +179,11 @@
     platformOpenURLExternally(url);
 }
 
+void RemoteWebInspectorUIProxy::revealFileExternally(const String& path)
+{
+    platformRevealFileExternally(path);
+}
+
 void RemoteWebInspectorUIProxy::showCertificate(const CertificateInfo& certificateInfo)
 {
     platformShowCertificate(certificateInfo);
@@ -243,6 +248,7 @@
 void RemoteWebInspectorUIProxy::platformSetForcedAppearance(InspectorFrontendClient::Appearance) { }
 void RemoteWebInspectorUIProxy::platformStartWindowDrag() { }
 void RemoteWebInspectorUIProxy::platformOpenURLExternally(const String&) { }
+void RemoteWebInspectorUIProxy::platformRevealFileExternally(const String&) { }
 void RemoteWebInspectorUIProxy::platformShowCertificate(const CertificateInfo&) { }
 void RemoteWebInspectorUIProxy::platformCloseFrontendPageAndWindow() { }
 #endif // !ENABLE(REMOTE_INSPECTOR) || (!PLATFORM(MAC) && !PLATFORM(GTK) && !PLATFORM(WIN))

Modified: trunk/Source/WebKit/UIProcess/Inspector/RemoteWebInspectorUIProxy.h (292119 => 292120)


--- trunk/Source/WebKit/UIProcess/Inspector/RemoteWebInspectorUIProxy.h	2022-03-30 20:51:38 UTC (rev 292119)
+++ trunk/Source/WebKit/UIProcess/Inspector/RemoteWebInspectorUIProxy.h	2022-03-30 20:55:57 UTC (rev 292120)
@@ -138,6 +138,7 @@
     void setForcedAppearance(WebCore::InspectorFrontendClient::Appearance);
     void startWindowDrag();
     void openURLExternally(const String& url);
+    void revealFileExternally(const String& path);
     void showCertificate(const WebCore::CertificateInfo&);
     void sendMessageToBackend(const String& message);
 
@@ -156,6 +157,7 @@
     void platformSetForcedAppearance(WebCore::InspectorFrontendClient::Appearance);
     void platformStartWindowDrag();
     void platformOpenURLExternally(const String& url);
+    void platformRevealFileExternally(const String& path);
     void platformShowCertificate(const WebCore::CertificateInfo&);
 
     RemoteWebInspectorUIProxyClient* m_client { nullptr };

Modified: trunk/Source/WebKit/UIProcess/Inspector/RemoteWebInspectorUIProxy.messages.in (292119 => 292120)


--- trunk/Source/WebKit/UIProcess/Inspector/RemoteWebInspectorUIProxy.messages.in	2022-03-30 20:51:38 UTC (rev 292119)
+++ trunk/Source/WebKit/UIProcess/Inspector/RemoteWebInspectorUIProxy.messages.in	2022-03-30 20:55:57 UTC (rev 292120)
@@ -38,6 +38,8 @@
     StartWindowDrag()
 
     OpenURLExternally(String url)
+    RevealFileExternally(String path)
+
     ShowCertificate(WebCore::CertificateInfo certificateInfo)
 
     SendMessageToBackend(String message)

Modified: trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.cpp (292119 => 292120)


--- trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.cpp	2022-03-30 20:51:38 UTC (rev 292119)
+++ trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.cpp	2022-03-30 20:55:57 UTC (rev 292120)
@@ -640,6 +640,11 @@
         m_inspectorClient->openURLExternally(*this, url);
 }
 
+void WebInspectorUIProxy::revealFileExternally(const String& path)
+{
+    platformRevealFileExternally(path);
+}
+
 void WebInspectorUIProxy::inspectedURLChanged(const String& urlString)
 {
     platformInspectedURLChanged(urlString);
@@ -815,6 +820,11 @@
     notImplemented();
 }
 
+void WebInspectorUIProxy::platformRevealFileExternally(const String&)
+{
+    notImplemented();
+}
+
 void WebInspectorUIProxy::platformInspectedURLChanged(const String&)
 {
     notImplemented();

Modified: trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.h (292119 => 292120)


--- trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.h	2022-03-30 20:51:38 UTC (rev 292119)
+++ trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.h	2022-03-30 20:55:57 UTC (rev 292120)
@@ -158,6 +158,7 @@
     void showResources();
     void showMainResourceForFrame(WebFrameProxy*);
     void openURLExternally(const String& url);
+    void revealFileExternally(const String& path);
 
     AttachmentSide attachmentSide() const { return m_attachmentSide; }
     bool isAttached() const { return m_isAttached; }
@@ -234,6 +235,7 @@
     void platformSetAttachedWindowWidth(unsigned);
     void platformSetSheetRect(const WebCore::FloatRect&);
     void platformStartWindowDrag();
+    void platformRevealFileExternally(const String&);
     void platformSave(const String& filename, const String& content, bool base64Encoded, bool forceSaveAs);
     void platformAppend(const String& filename, const String& content);
     void platformLoad(const String& path, CompletionHandler<void(const String&)>&&);

Modified: trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.messages.in (292119 => 292120)


--- trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.messages.in	2022-03-30 20:51:38 UTC (rev 292119)
+++ trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.messages.in	2022-03-30 20:55:57 UTC (rev 292120)
@@ -35,6 +35,7 @@
 
     SetForcedAppearance(WebCore::InspectorFrontendClient::Appearance appearance)
     OpenURLExternally(String url)
+    RevealFileExternally(String path)
 
     InspectedURLChanged(String urlString)
     ShowCertificate(WebCore::CertificateInfo certificateInfo)

Modified: trunk/Source/WebKit/UIProcess/Inspector/gtk/RemoteWebInspectorUIProxyGtk.cpp (292119 => 292120)


--- trunk/Source/WebKit/UIProcess/Inspector/gtk/RemoteWebInspectorUIProxyGtk.cpp	2022-03-30 20:51:38 UTC (rev 292119)
+++ trunk/Source/WebKit/UIProcess/Inspector/gtk/RemoteWebInspectorUIProxyGtk.cpp	2022-03-30 20:55:57 UTC (rev 292120)
@@ -183,6 +183,10 @@
 {
 }
 
+void RemoteWebInspectorUIProxy::platformRevealFileExternally(const String&)
+{
+}
+
 void RemoteWebInspectorUIProxy::platformShowCertificate(const CertificateInfo&)
 {
 }

Modified: trunk/Source/WebKit/UIProcess/Inspector/gtk/WebInspectorUIProxyGtk.cpp (292119 => 292120)


--- trunk/Source/WebKit/UIProcess/Inspector/gtk/WebInspectorUIProxyGtk.cpp	2022-03-30 20:51:38 UTC (rev 292119)
+++ trunk/Source/WebKit/UIProcess/Inspector/gtk/WebInspectorUIProxyGtk.cpp	2022-03-30 20:55:57 UTC (rev 292120)
@@ -368,6 +368,11 @@
     notImplemented();
 }
 
+void WebInspectorUIProxy::platformRevealFileExternally(const String&)
+{
+    notImplemented();
+}
+
 void WebInspectorUIProxy::platformInspectedURLChanged(const String& url)
 {
     m_inspectedURLString = url;

Modified: trunk/Source/WebKit/UIProcess/Inspector/mac/RemoteWebInspectorUIProxyMac.mm (292119 => 292120)


--- trunk/Source/WebKit/UIProcess/Inspector/mac/RemoteWebInspectorUIProxyMac.mm	2022-03-30 20:51:38 UTC (rev 292119)
+++ trunk/Source/WebKit/UIProcess/Inspector/mac/RemoteWebInspectorUIProxyMac.mm	2022-03-30 20:55:57 UTC (rev 292120)
@@ -280,6 +280,11 @@
     [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:url]];
 }
 
+void RemoteWebInspectorUIProxy::platformRevealFileExternally(const String& path)
+{
+    [[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:@[ [NSURL URLWithString:path] ]];
+}
+
 void RemoteWebInspectorUIProxy::platformShowCertificate(const CertificateInfo& certificateInfo)
 {
     ASSERT(!certificateInfo.isEmpty());

Modified: trunk/Source/WebKit/UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm (292119 => 292120)


--- trunk/Source/WebKit/UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm	2022-03-30 20:51:38 UTC (rev 292119)
+++ trunk/Source/WebKit/UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm	2022-03-30 20:55:57 UTC (rev 292120)
@@ -496,6 +496,11 @@
     [certificateView setDetailsDisclosed:YES];
 }
 
+void WebInspectorUIProxy::platformRevealFileExternally(const String& path)
+{
+    [[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:@[ [NSURL URLWithString:path] ]];
+}
+
 void WebInspectorUIProxy::platformSave(const String& suggestedURL, const String& content, bool base64Encoded, bool forceSaveDialog)
 {
     ASSERT(!suggestedURL.isEmpty());

Modified: trunk/Source/WebKit/UIProcess/Inspector/win/RemoteWebInspectorUIProxyWin.cpp (292119 => 292120)


--- trunk/Source/WebKit/UIProcess/Inspector/win/RemoteWebInspectorUIProxyWin.cpp	2022-03-30 20:51:38 UTC (rev 292119)
+++ trunk/Source/WebKit/UIProcess/Inspector/win/RemoteWebInspectorUIProxyWin.cpp	2022-03-30 20:55:57 UTC (rev 292120)
@@ -139,6 +139,7 @@
 void RemoteWebInspectorUIProxy::platformSetForcedAppearance(WebCore::InspectorFrontendClient::Appearance) { }
 void RemoteWebInspectorUIProxy::platformStartWindowDrag() { }
 void RemoteWebInspectorUIProxy::platformOpenURLExternally(const String&) { }
+void RemoteWebInspectorUIProxy::platformRevealFileExternally(const String&) { }
 void RemoteWebInspectorUIProxy::platformShowCertificate(const WebCore::CertificateInfo&) { }
 
 void RemoteWebInspectorUIProxy::platformCloseFrontendPageAndWindow()

Modified: trunk/Source/WebKit/UIProcess/Inspector/win/WebInspectorUIProxyWin.cpp (292119 => 292120)


--- trunk/Source/WebKit/UIProcess/Inspector/win/WebInspectorUIProxyWin.cpp	2022-03-30 20:51:38 UTC (rev 292119)
+++ trunk/Source/WebKit/UIProcess/Inspector/win/WebInspectorUIProxyWin.cpp	2022-03-30 20:55:57 UTC (rev 292120)
@@ -398,6 +398,11 @@
     notImplemented();
 }
 
+void WebInspectorUIProxy::platformRevealFileExternally(const String&)
+{
+    notImplemented();
+}
+
 void WebInspectorUIProxy::platformInspectedURLChanged(const String& /* url */)
 {
     notImplemented();

Modified: trunk/Source/WebKit/WebProcess/Inspector/RemoteWebInspectorUI.cpp (292119 => 292120)


--- trunk/Source/WebKit/WebProcess/Inspector/RemoteWebInspectorUI.cpp	2022-03-30 20:51:38 UTC (rev 292119)
+++ trunk/Source/WebKit/WebProcess/Inspector/RemoteWebInspectorUI.cpp	2022-03-30 20:55:57 UTC (rev 292120)
@@ -218,6 +218,11 @@
     WebProcess::singleton().parentProcessConnection()->send(Messages::RemoteWebInspectorUIProxy::OpenURLExternally(url), m_page.identifier());
 }
 
+void RemoteWebInspectorUI::revealFileExternally(const String& path)
+{
+    WebProcess::singleton().parentProcessConnection()->send(Messages::RemoteWebInspectorUIProxy::RevealFileExternally(path), m_page.identifier());
+}
+
 void RemoteWebInspectorUI::save(const String& filename, const String& content, bool base64Encoded, bool forceSaveAs)
 {
     WebProcess::singleton().parentProcessConnection()->send(Messages::RemoteWebInspectorUIProxy::Save(filename, content, base64Encoded, forceSaveAs), m_page.identifier());

Modified: trunk/Source/WebKit/WebProcess/Inspector/RemoteWebInspectorUI.h (292119 => 292120)


--- trunk/Source/WebKit/WebProcess/Inspector/RemoteWebInspectorUI.h	2022-03-30 20:51:38 UTC (rev 292119)
+++ trunk/Source/WebKit/WebProcess/Inspector/RemoteWebInspectorUI.h	2022-03-30 20:55:57 UTC (rev 292120)
@@ -105,6 +105,7 @@
     void resetState() override;
 
     void openURLExternally(const String& url) override;
+    void revealFileExternally(const String& path) override;
     void save(const String& url, const String& content, bool base64Encoded, bool forceSaveAs) override;
     void append(const String& url, const String& content) override;
     void load(const String& path, CompletionHandler<void(const String&)>&&) override;

Modified: trunk/Source/WebKit/WebProcess/Inspector/WebInspectorUI.cpp (292119 => 292120)


--- trunk/Source/WebKit/WebProcess/Inspector/WebInspectorUI.cpp	2022-03-30 20:51:38 UTC (rev 292119)
+++ trunk/Source/WebKit/WebProcess/Inspector/WebInspectorUI.cpp	2022-03-30 20:55:57 UTC (rev 292120)
@@ -293,6 +293,11 @@
     WebProcess::singleton().parentProcessConnection()->send(Messages::WebInspectorUIProxy::OpenURLExternally(url), m_inspectedPageIdentifier);
 }
 
+void WebInspectorUI::revealFileExternally(const String& path)
+{
+    WebProcess::singleton().parentProcessConnection()->send(Messages::WebInspectorUIProxy::RevealFileExternally(path), m_inspectedPageIdentifier);
+}
+
 void WebInspectorUI::save(const WTF::String& filename, const WTF::String& content, bool base64Encoded, bool forceSaveAs)
 {
     WebProcess::singleton().parentProcessConnection()->send(Messages::WebInspectorUIProxy::Save(filename, content, base64Encoded, forceSaveAs), m_inspectedPageIdentifier);

Modified: trunk/Source/WebKit/WebProcess/Inspector/WebInspectorUI.h (292119 => 292120)


--- trunk/Source/WebKit/WebProcess/Inspector/WebInspectorUI.h	2022-03-30 20:51:38 UTC (rev 292119)
+++ trunk/Source/WebKit/WebProcess/Inspector/WebInspectorUI.h	2022-03-30 20:55:57 UTC (rev 292120)
@@ -139,7 +139,7 @@
     void changeSheetRect(const WebCore::FloatRect&) override;
 
     void openURLExternally(const String& url) override;
-
+    void revealFileExternally(const String& path) override;
     bool canSave() override;
     void save(const WTF::String& url, const WTF::String& content, bool base64Encoded, bool forceSaveAs) override;
     void append(const WTF::String& url, const WTF::String& content) override;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to