Changeset 292120 in webkit
- Timestamp:
- Mar 30, 2022 1:55:57 PM (4 months ago)
- Location:
- trunk/Source
- Files:
-
- 26 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/inspector/InspectorFrontendClient.h (modified) (1 diff)
-
WebCore/inspector/InspectorFrontendClientLocal.h (modified) (1 diff)
-
WebCore/inspector/InspectorFrontendHost.cpp (modified) (1 diff)
-
WebCore/inspector/InspectorFrontendHost.h (modified) (1 diff)
-
WebCore/inspector/InspectorFrontendHost.idl (modified) (1 diff)
-
WebInspectorUI/ChangeLog (modified) (1 diff)
-
WebInspectorUI/UserInterface/Base/Main.js (modified) (1 diff)
-
WebInspectorUI/UserInterface/Views/ResourceContentView.js (modified) (1 diff)
-
WebKit/ChangeLog (modified) (1 diff)
-
WebKit/UIProcess/Inspector/RemoteWebInspectorUIProxy.cpp (modified) (2 diffs)
-
WebKit/UIProcess/Inspector/RemoteWebInspectorUIProxy.h (modified) (2 diffs)
-
WebKit/UIProcess/Inspector/RemoteWebInspectorUIProxy.messages.in (modified) (1 diff)
-
WebKit/UIProcess/Inspector/WebInspectorUIProxy.cpp (modified) (2 diffs)
-
WebKit/UIProcess/Inspector/WebInspectorUIProxy.h (modified) (2 diffs)
-
WebKit/UIProcess/Inspector/WebInspectorUIProxy.messages.in (modified) (1 diff)
-
WebKit/UIProcess/Inspector/gtk/RemoteWebInspectorUIProxyGtk.cpp (modified) (1 diff)
-
WebKit/UIProcess/Inspector/gtk/WebInspectorUIProxyGtk.cpp (modified) (1 diff)
-
WebKit/UIProcess/Inspector/mac/RemoteWebInspectorUIProxyMac.mm (modified) (1 diff)
-
WebKit/UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm (modified) (1 diff)
-
WebKit/UIProcess/Inspector/win/RemoteWebInspectorUIProxyWin.cpp (modified) (1 diff)
-
WebKit/UIProcess/Inspector/win/WebInspectorUIProxyWin.cpp (modified) (1 diff)
-
WebKit/WebProcess/Inspector/RemoteWebInspectorUI.cpp (modified) (1 diff)
-
WebKit/WebProcess/Inspector/RemoteWebInspectorUI.h (modified) (1 diff)
-
WebKit/WebProcess/Inspector/WebInspectorUI.cpp (modified) (1 diff)
-
WebKit/WebProcess/Inspector/WebInspectorUI.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r292118 r292120 1 2022-03-30 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Sources: the mapped file URL of a Response Local Override should be clickable 4 https://bugs.webkit.org/show_bug.cgi?id=238533 5 6 Reviewed by Patrick Angle. 7 8 * inspector/InspectorFrontendHost.h: 9 * inspector/InspectorFrontendHost.idl: 10 * inspector/InspectorFrontendHost.cpp: 11 (WebCore::InspectorFrontendHost::revealFileExternally): Added. 12 Add a helper for selecting a file in the system file explorer. 13 14 * inspector/InspectorFrontendClient.h: 15 * inspector/InspectorFrontendClientLocal.h: 16 (WebCore::InspectorFrontendClientLocal::revealFileExternally): Added. 17 Do nothing in tests (and WK1) as there is no way to check for another app being opened. 18 1 19 2022-03-30 Chris Dumez <cdumez@apple.com> 2 20 -
trunk/Source/WebCore/inspector/InspectorFrontendClient.h
r292084 r292120 107 107 108 108 WEBCORE_EXPORT virtual void openURLExternally(const String& url) = 0; 109 WEBCORE_EXPORT virtual void revealFileExternally(const String& path) = 0; 109 110 virtual bool canSave() = 0; 110 111 virtual void save(const String& url, const String& content, bool base64Encoded, bool forceSaveAs) = 0; -
trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.h
r292084 r292120 81 81 WEBCORE_EXPORT void changeSheetRect(const FloatRect&) final; 82 82 WEBCORE_EXPORT void openURLExternally(const String& url) final; 83 void revealFileExternally(const String&) override { } 83 84 bool canSave() override { return false; } 84 85 void save(const String&, const String&, bool, bool) override { } -
trunk/Source/WebCore/inspector/InspectorFrontendHost.cpp
r292100 r292120 445 445 } 446 446 447 void InspectorFrontendHost::revealFileExternally(const String& path) 448 { 449 if (!WTF::protocolIs(path, "file")) 450 return; 451 452 if (m_client) 453 m_client->revealFileExternally(path); 454 } 455 447 456 bool InspectorFrontendHost::canSave() 448 457 { -
trunk/Source/WebCore/inspector/InspectorFrontendHost.h
r292084 r292120 109 109 void killText(const String& text, bool shouldPrependToKillRing, bool shouldStartNewSequence); 110 110 void openURLExternally(const String& url); 111 void revealFileExternally(const String& path); 111 112 bool canSave(); 112 113 void save(const String& url, const String& content, bool base64Encoded, bool forceSaveAs); -
trunk/Source/WebCore/inspector/InspectorFrontendHost.idl
r292084 r292120 72 72 undefined killText(DOMString text, boolean shouldPrependToKillRing, boolean shouldStartNewSequence); 73 73 undefined openURLExternally(DOMString url); 74 undefined revealFileExternally(DOMString path); 74 75 boolean canSave(); 75 76 undefined save(DOMString url, DOMString content, boolean base64Encoded, boolean forceSaveAs); -
trunk/Source/WebInspectorUI/ChangeLog
r292084 r292120 1 2022-03-30 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Sources: the mapped file URL of a Response Local Override should be clickable 4 https://bugs.webkit.org/show_bug.cgi?id=238533 5 6 Reviewed by Patrick Angle. 7 8 * UserInterface/Views/ResourceContentView.js: 9 (WI.ResourceContentView.prototype._handleMappedFilePathChanged): 10 Instead of showing the mapped file path as basic text, linkify it such that it is shown in 11 the system file explorer when clicked. 12 13 * UserInterface/Base/Main.js: 14 (WI.createMessageTextView): 15 Allow the `message` to be a `Node` (in addition to a `String`). 16 1 17 2022-03-29 Devin Rousso <drousso@apple.com> 2 18 -
trunk/Source/WebInspectorUI/UserInterface/Base/Main.js
r291093 r292120 3085 3085 let textElement = messageElement.appendChild(document.createElement("div")); 3086 3086 textElement.className = "message"; 3087 textElement. textContent = message;3087 textElement.append(message); 3088 3088 3089 3089 return messageElement; -
trunk/Source/WebInspectorUI/UserInterface/Views/ResourceContentView.js
r292084 r292120 385 385 _handleMappedFilePathChanged(event) 386 386 { 387 this.showMessage(WI.UIString("Mapped to \u201C%s\u201D").format(this.resource.mappedFilePath)); 387 let mappedFilePath = this.resource.mappedFilePath; 388 389 let mappedFilePathLink = document.createElement("a"); 390 mappedFilePathLink.href = "file://" + mappedFilePath; 391 mappedFilePathLink.textContent = mappedFilePath; 392 mappedFilePathLink.addEventListener("click", (event) => { 393 event.stop(); 394 395 InspectorFrontendHost.revealFileExternally(event.target.href); 396 }); 397 398 let fragment = document.createDocumentFragment(); 399 String.format(WI.UIString("Mapped to \u201C%s\u201D"), [mappedFilePathLink], String.standardFormatters, fragment, (a, b) => { 400 a.append(b); 401 return a; 402 }); 403 this.showMessage(fragment); 388 404 389 405 if (this._localResourceOverrideBannerView) { -
trunk/Source/WebKit/ChangeLog
r292119 r292120 1 2022-03-30 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Sources: the mapped file URL of a Response Local Override should be clickable 4 https://bugs.webkit.org/show_bug.cgi?id=238533 5 6 Reviewed by Patrick Angle. 7 8 * WebProcess/Inspector/RemoteWebInspectorUI.h: 9 * WebProcess/Inspector/RemoteWebInspectorUI.cpp: 10 (WebKit::RemoteWebInspectorUI::revealFileExternally): Added. 11 * WebProcess/Inspector/WebInspectorUI.h: 12 * WebProcess/Inspector/WebInspectorUI.cpp: 13 (WebKit::WebInspectorUI::revealFileExternally): Added. 14 * UIProcess/Inspector/WebInspectorUIProxy.messages.in: 15 * UIProcess/Inspector/WebInspectorUIProxy.h: 16 * UIProcess/Inspector/WebInspectorUIProxy.cpp: 17 (WebKit::WebInspectorUIProxy::revealFileExternally): Added. 18 (WebKit::WebInspectorUIProxy::platformRevealFileExternally): Added. 19 * UIProcess/Inspector/gtk/WebInspectorUIProxyGtk.mm: 20 (WebKit::WebInspectorUIProxy::platformRevealFileExternally): Added. 21 * UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm: 22 (WebKit::WebInspectorUIProxy::platformRevealFileExternally): Added. 23 * UIProcess/Inspector/win/WebInspectorUIProxyWin.mm: 24 (WebKit::WebInspectorUIProxy::platformRevealFileExternally): Added. 25 * UIProcess/Inspector/RemoteWebInspectorUIProxy.messages.in: 26 * UIProcess/Inspector/RemoteWebInspectorUIProxy.h: 27 * UIProcess/Inspector/RemoteWebInspectorUIProxy.cpp: 28 (WebKit::RemoteWebInspectorUIProxy::revealFileExternally): Added. 29 (WebKit::RemoteWebInspectorUIProxy::platformRevealFileExternally): Added. 30 * UIProcess/Inspector/gtk/RemoteWebInspectorUIProxyGtk.cpp: 31 (WebKit::RemoteWebInspectorUIProxy::platformRevealFileExternally): Added. 32 * UIProcess/Inspector/mac/RemoteWebInspectorUIProxyMac.mm: 33 (WebKit::RemoteWebInspectorUIProxy::platformRevealFileExternally): Added. 34 * UIProcess/Inspector/win/RemoteWebInspectorUIProxyWin.cpp: 35 (WebKit::RemoteWebInspectorUIProxy::platformRevealFileExternally): Added. 36 Add a helper for selecting a file in the system file explorer. 37 1 38 2022-03-30 Sihui Liu <sihui_liu@apple.com> 2 39 -
trunk/Source/WebKit/UIProcess/Inspector/RemoteWebInspectorUIProxy.cpp
r292084 r292120 180 180 } 181 181 182 void RemoteWebInspectorUIProxy::revealFileExternally(const String& path) 183 { 184 platformRevealFileExternally(path); 185 } 186 182 187 void RemoteWebInspectorUIProxy::showCertificate(const CertificateInfo& certificateInfo) 183 188 { … … 244 249 void RemoteWebInspectorUIProxy::platformStartWindowDrag() { } 245 250 void RemoteWebInspectorUIProxy::platformOpenURLExternally(const String&) { } 251 void RemoteWebInspectorUIProxy::platformRevealFileExternally(const String&) { } 246 252 void RemoteWebInspectorUIProxy::platformShowCertificate(const CertificateInfo&) { } 247 253 void RemoteWebInspectorUIProxy::platformCloseFrontendPageAndWindow() { } -
trunk/Source/WebKit/UIProcess/Inspector/RemoteWebInspectorUIProxy.h
r292084 r292120 139 139 void startWindowDrag(); 140 140 void openURLExternally(const String& url); 141 void revealFileExternally(const String& path); 141 142 void showCertificate(const WebCore::CertificateInfo&); 142 143 void sendMessageToBackend(const String& message); … … 157 158 void platformStartWindowDrag(); 158 159 void platformOpenURLExternally(const String& url); 160 void platformRevealFileExternally(const String& path); 159 161 void platformShowCertificate(const WebCore::CertificateInfo&); 160 162 -
trunk/Source/WebKit/UIProcess/Inspector/RemoteWebInspectorUIProxy.messages.in
r292084 r292120 39 39 40 40 OpenURLExternally(String url) 41 RevealFileExternally(String path) 42 41 43 ShowCertificate(WebCore::CertificateInfo certificateInfo) 42 44 -
trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.cpp
r292084 r292120 641 641 } 642 642 643 void WebInspectorUIProxy::revealFileExternally(const String& path) 644 { 645 platformRevealFileExternally(path); 646 } 647 643 648 void WebInspectorUIProxy::inspectedURLChanged(const String& urlString) 644 649 { … … 816 821 } 817 822 823 void WebInspectorUIProxy::platformRevealFileExternally(const String&) 824 { 825 notImplemented(); 826 } 827 818 828 void WebInspectorUIProxy::platformInspectedURLChanged(const String&) 819 829 { -
trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.h
r292084 r292120 159 159 void showMainResourceForFrame(WebFrameProxy*); 160 160 void openURLExternally(const String& url); 161 void revealFileExternally(const String& path); 161 162 162 163 AttachmentSide attachmentSide() const { return m_attachmentSide; } … … 235 236 void platformSetSheetRect(const WebCore::FloatRect&); 236 237 void platformStartWindowDrag(); 238 void platformRevealFileExternally(const String&); 237 239 void platformSave(const String& filename, const String& content, bool base64Encoded, bool forceSaveAs); 238 240 void platformAppend(const String& filename, const String& content); -
trunk/Source/WebKit/UIProcess/Inspector/WebInspectorUIProxy.messages.in
r292084 r292120 36 36 SetForcedAppearance(WebCore::InspectorFrontendClient::Appearance appearance) 37 37 OpenURLExternally(String url) 38 RevealFileExternally(String path) 38 39 39 40 InspectedURLChanged(String urlString) -
trunk/Source/WebKit/UIProcess/Inspector/gtk/RemoteWebInspectorUIProxyGtk.cpp
r292084 r292120 184 184 } 185 185 186 void RemoteWebInspectorUIProxy::platformRevealFileExternally(const String&) 187 { 188 } 189 186 190 void RemoteWebInspectorUIProxy::platformShowCertificate(const CertificateInfo&) 187 191 { -
trunk/Source/WebKit/UIProcess/Inspector/gtk/WebInspectorUIProxyGtk.cpp
r292084 r292120 369 369 } 370 370 371 void WebInspectorUIProxy::platformRevealFileExternally(const String&) 372 { 373 notImplemented(); 374 } 375 371 376 void WebInspectorUIProxy::platformInspectedURLChanged(const String& url) 372 377 { -
trunk/Source/WebKit/UIProcess/Inspector/mac/RemoteWebInspectorUIProxyMac.mm
r292084 r292120 281 281 } 282 282 283 void RemoteWebInspectorUIProxy::platformRevealFileExternally(const String& path) 284 { 285 [[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:@[ [NSURL URLWithString:path] ]]; 286 } 287 283 288 void RemoteWebInspectorUIProxy::platformShowCertificate(const CertificateInfo& certificateInfo) 284 289 { -
trunk/Source/WebKit/UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm
r292084 r292120 497 497 } 498 498 499 void WebInspectorUIProxy::platformRevealFileExternally(const String& path) 500 { 501 [[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:@[ [NSURL URLWithString:path] ]]; 502 } 503 499 504 void WebInspectorUIProxy::platformSave(const String& suggestedURL, const String& content, bool base64Encoded, bool forceSaveDialog) 500 505 { -
trunk/Source/WebKit/UIProcess/Inspector/win/RemoteWebInspectorUIProxyWin.cpp
r292084 r292120 140 140 void RemoteWebInspectorUIProxy::platformStartWindowDrag() { } 141 141 void RemoteWebInspectorUIProxy::platformOpenURLExternally(const String&) { } 142 void RemoteWebInspectorUIProxy::platformRevealFileExternally(const String&) { } 142 143 void RemoteWebInspectorUIProxy::platformShowCertificate(const WebCore::CertificateInfo&) { } 143 144 -
trunk/Source/WebKit/UIProcess/Inspector/win/WebInspectorUIProxyWin.cpp
r292084 r292120 399 399 } 400 400 401 void WebInspectorUIProxy::platformRevealFileExternally(const String&) 402 { 403 notImplemented(); 404 } 405 401 406 void WebInspectorUIProxy::platformInspectedURLChanged(const String& /* url */) 402 407 { -
trunk/Source/WebKit/WebProcess/Inspector/RemoteWebInspectorUI.cpp
r292084 r292120 219 219 } 220 220 221 void RemoteWebInspectorUI::revealFileExternally(const String& path) 222 { 223 WebProcess::singleton().parentProcessConnection()->send(Messages::RemoteWebInspectorUIProxy::RevealFileExternally(path), m_page.identifier()); 224 } 225 221 226 void RemoteWebInspectorUI::save(const String& filename, const String& content, bool base64Encoded, bool forceSaveAs) 222 227 { -
trunk/Source/WebKit/WebProcess/Inspector/RemoteWebInspectorUI.h
r292084 r292120 106 106 107 107 void openURLExternally(const String& url) override; 108 void revealFileExternally(const String& path) override; 108 109 void save(const String& url, const String& content, bool base64Encoded, bool forceSaveAs) override; 109 110 void append(const String& url, const String& content) override; -
trunk/Source/WebKit/WebProcess/Inspector/WebInspectorUI.cpp
r292102 r292120 294 294 } 295 295 296 void WebInspectorUI::revealFileExternally(const String& path) 297 { 298 WebProcess::singleton().parentProcessConnection()->send(Messages::WebInspectorUIProxy::RevealFileExternally(path), m_inspectedPageIdentifier); 299 } 300 296 301 void WebInspectorUI::save(const WTF::String& filename, const WTF::String& content, bool base64Encoded, bool forceSaveAs) 297 302 { -
trunk/Source/WebKit/WebProcess/Inspector/WebInspectorUI.h
r292084 r292120 140 140 141 141 void openURLExternally(const String& url) override; 142 142 void revealFileExternally(const String& path) override; 143 143 bool canSave() override; 144 144 void save(const WTF::String& url, const WTF::String& content, bool base64Encoded, bool forceSaveAs) override;
Note: See TracChangeset
for help on using the changeset viewer.