Fix or disable some deprecation warnings.
authormrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Oct 2013 20:16:56 +0000 (20:16 +0000)
committermrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Oct 2013 20:16:56 +0000 (20:16 +0000)
Reviewed by Darin Adler.

* Panels/WebAuthenticationPanel.m:
(-[WebAuthenticationPanel cancel:]): On newer OS versions, use the modern API.
(-[WebAuthenticationPanel logIn:]): Ditto.
(-[WebAuthenticationPanel runAsSheetOnWindow:withChallenge:]): Ditto. Translate the
response code in to the form that -sheetDidEnd:responseCode:contextInfo: expects.
* WebView/WebClipView.mm:
(-[WebClipView initWithFrame:]): Disable deprecation warnings since it's not obvious
how to avoid calling -releaseGState here.

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

Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Panels/WebAuthenticationPanel.m
Source/WebKit/mac/WebView/WebClipView.mm

index 8e50030..c244278 100644 (file)
@@ -1,3 +1,18 @@
+2013-10-25  Mark Rowe  <mrowe@apple.com>
+
+        Fix or disable some deprecation warnings.
+
+        Reviewed by Darin Adler.
+
+        * Panels/WebAuthenticationPanel.m:
+        (-[WebAuthenticationPanel cancel:]): On newer OS versions, use the modern API.
+        (-[WebAuthenticationPanel logIn:]): Ditto.
+        (-[WebAuthenticationPanel runAsSheetOnWindow:withChallenge:]): Ditto. Translate the
+        response code in to the form that -sheetDidEnd:responseCode:contextInfo: expects.
+        * WebView/WebClipView.mm:
+        (-[WebClipView initWithFrame:]): Disable deprecation warnings since it's not obvious
+        how to avoid calling -releaseGState here.
+
 2013-10-24  Mark Rowe  <mrowe@apple.com>
 
         Remove references to OS X 10.7 from Xcode configuration settings.
index 3dada58..715e7a2 100644 (file)
 
     [panel close];
     if (usingSheet) {
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
+        [panel.sheetParent endSheet:panel returnCode:NSModalResponseCancel];
+#else
         [[NSApplication sharedApplication] endSheet:panel returnCode:1];
+#endif
     } else {
         [[NSApplication sharedApplication] stopModalWithCode:1];
     }
 
     [panel close];
     if (usingSheet) {
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
+        [panel.sheetParent endSheet:panel returnCode:NSModalResponseOK];
+#else
         [[NSApplication sharedApplication] endSheet:panel returnCode:0];
+#endif
     } else {
         [[NSApplication sharedApplication] stopModalWithCode:0];
     }
 
     usingSheet = TRUE;
     challenge = [chall retain];
-    
+
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
+    [window beginSheet:panel completionHandler:^(NSModalResponse modalResponse) {
+        int returnCode = (modalResponse == NSModalResponseCancel) ? 1 : 0;
+        [self sheetDidEnd:panel returnCode:returnCode contextInfo:NULL];
+    }];
+#else
     [[NSApplication sharedApplication] beginSheet:panel modalForWindow:window modalDelegate:self didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:) contextInfo:NULL];
+#endif
 }
 
 - (void)sheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void  *)contextInfo
index d95100c..0efbf08 100644 (file)
@@ -64,7 +64,9 @@ using namespace WebCore;
     self = [super initWithFrame:frame];
     if (!self)
         return nil;
-    
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
     // In WebHTMLView, we set a clip. This is not typical to do in an
     // NSView, and while correct for any one invocation of drawRect:,
     // it causes some bad problems if that clip is cached between calls.
@@ -75,7 +77,8 @@ using namespace WebCore;
     // See these bugs for more information:
     // <rdar://problem/3409315>: REGRESSSION (7B58-7B60)?: Safari draws blank frames on macosx.apple.com perf page
     [self releaseGState];
-    
+#pragma clang diagnostic pop
+
     return self;
 }