Web Inspector: Use save sheet instead of dialog where possible
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Jan 2019 00:33:57 +0000 (00:33 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Jan 2019 00:33:57 +0000 (00:33 +0000)
https://bugs.webkit.org/show_bug.cgi?id=193160
<rdar://problem/37399759>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-01-04
Reviewed by Devin Rousso.

Source/WebKit:

* UIProcess/mac/RemoteWebInspectorProxyMac.mm:
(WebKit::RemoteWebInspectorProxy::platformSave):
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::platformSave):

Source/WebKitLegacy/mac:

* WebCoreSupport/WebInspectorClient.mm:
(WebInspectorFrontendClient::save):

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

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/mac/RemoteWebInspectorProxyMac.mm
Source/WebKit/UIProcess/mac/WebInspectorProxyMac.mm
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebCoreSupport/WebInspectorClient.mm

index 5206e42..0335e45 100644 (file)
@@ -1,3 +1,16 @@
+2019-01-04  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Use save sheet instead of dialog where possible
+        https://bugs.webkit.org/show_bug.cgi?id=193160
+        <rdar://problem/37399759>
+
+        Reviewed by Devin Rousso.
+
+        * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
+        (WebKit::RemoteWebInspectorProxy::platformSave):
+        * UIProcess/mac/WebInspectorProxyMac.mm:
+        (WebKit::WebInspectorProxy::platformSave):
+
 2019-01-04  Jer Noble  <jer.noble@apple.com>
 
         [WebKitLegacy] Media playback pauses on scroll
index ae9f25b..caee26b 100644 (file)
@@ -180,8 +180,9 @@ void RemoteWebInspectorProxy::platformSave(const String& suggestedURL, const Str
         saveToURL(panel.URL);
     };
 
-    if (m_window)
-        [panel beginSheetModalForWindow:m_window.get() completionHandler:completionHandler];
+    NSWindow *window = m_window ? m_window.get() : [NSApp keyWindow];
+    if (window)
+        [panel beginSheetModalForWindow:window completionHandler:completionHandler];
     else
         completionHandler([panel runModal]);
 }
index 1210067..86ef945 100644 (file)
@@ -494,8 +494,9 @@ void WebInspectorProxy::platformSave(const String& suggestedURL, const String& c
         saveToURL(panel.URL);
     };
 
-    if (m_inspectorWindow)
-        [panel beginSheetModalForWindow:m_inspectorWindow.get() completionHandler:completionHandler];
+    NSWindow *window = m_inspectorWindow ? m_inspectorWindow.get() : [NSApp keyWindow];
+    if (window)
+        [panel beginSheetModalForWindow:window completionHandler:completionHandler];
     else
         completionHandler([panel runModal]);
 }
index e6c9f0a..d8340a7 100644 (file)
@@ -1,3 +1,14 @@
+2019-01-04  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Use save sheet instead of dialog where possible
+        https://bugs.webkit.org/show_bug.cgi?id=193160
+        <rdar://problem/37399759>
+
+        Reviewed by Devin Rousso.
+
+        * WebCoreSupport/WebInspectorClient.mm:
+        (WebInspectorFrontendClient::save):
+
 2019-01-04  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         [Cocoa] Merge WebEditCommandProxy::nameForEditAction and undoNameForEditAction into a single function
index dc6c3b8..28951a4 100644 (file)
@@ -374,8 +374,9 @@ void WebInspectorFrontendClient::save(const String& suggestedURL, const String&
     };
 
     NSWindow *frontendWindow = [[m_frontendWindowController frontendWebView] window];
-    if (frontendWindow)
-        [panel beginSheetModalForWindow:frontendWindow completionHandler:completionHandler];
+    NSWindow *window = frontendWindow ? frontendWindow : [NSApp keyWindow];
+    if (window)
+        [panel beginSheetModalForWindow:window completionHandler:completionHandler];
     else
         completionHandler([panel runModal]);
 }