mac: bump deployment target to 10.10

This change:
1) Marks uses of launch_data_t as deprecated with no replacement (so ignored);
2) Marks uses of the NSObject accessibility API as deprecated to be replaced
   (per bug 921109)
3) Replaces one use of CWInterface with a corresponding use of CWWiFiClient, and
   marks another as ignored for now;
4) Replaces some LaunchServices invocations with their new equivalents;
5) Marks GTM to ignore deprecation warnings, since the GTM dependency will go
   away soon anyway;
6) Fixes how blink refers to NSCalendarIdentifierGregorian;
7) Replaces some uses of NSRunAlertPanel with explicit constructions of NSAlert;
8) Bumps the deployment target to 10.10

An earlier version of this change attempted to incrementally upgrade, but many
of the replacement APIs are themselves only @available on 10.10, so it proved
to be significantly uglier.

Bug: 841631
Change-Id: Ic6e96efbb84ba0a077eda3528b452137d64f5f02
Reviewed-on: https://chromium-review.googlesource.com/c/1407177
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-by: Mike Pinkerton <pinkerton@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#625380}
diff --git a/base/mac/launchd.cc b/base/mac/launchd.cc
index 0337d2e..ded1306 100644
--- a/base/mac/launchd.cc
+++ b/base/mac/launchd.cc
@@ -7,6 +7,11 @@
 #include "base/logging.h"
 #include "base/mac/scoped_launch_data.h"
 
+// This file is written in terms of launch_data_t, which is deprecated but has
+// no replacement. Ignore the deprecation warnings for now.
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+
 namespace base {
 namespace mac {
 
@@ -73,3 +78,5 @@
 
 }  // namespace mac
 }  // namespace base
+
+#pragma clang diagnostic pop
diff --git a/base/mac/mac_util.mm b/base/mac/mac_util.mm
index 4c6a0d1..e4177d3 100644
--- a/base/mac/mac_util.mm
+++ b/base/mac/mac_util.mm
@@ -98,13 +98,16 @@
   for(NSUInteger i = 0; i < [login_items_array count]; ++i) {
     LSSharedFileListItemRef item =
         reinterpret_cast<LSSharedFileListItemRef>(login_items_array[i]);
-    CFURLRef item_url_ref = NULL;
+    base::ScopedCFTypeRef<CFErrorRef> error;
+    CFURLRef item_url_ref =
+        LSSharedFileListItemCopyResolvedURL(item, 0, error.InitializeInto());
 
-    // It seems that LSSharedFileListItemResolve() can return NULL in
-    // item_url_ref even if the function itself returns noErr. See
-    // https://crbug.com/760989
-    if (LSSharedFileListItemResolve(item, 0, &item_url_ref, NULL) == noErr &&
-        item_url_ref) {
+    // This function previously used LSSharedFileListItemResolve(), which could
+    // return a NULL URL even when returning no error. This caused
+    // <https://crbug.com/760989>. It's not clear one way or the other whether
+    // LSSharedFileListItemCopyResolvedURL() shares this behavior, so this check
+    // remains in place.
+    if (!error && item_url_ref) {
       ScopedCFTypeRef<CFURLRef> item_url(item_url_ref);
       if (CFEqual(item_url, url)) {
         CFRetain(item);
diff --git a/base/mac/scoped_launch_data.h b/base/mac/scoped_launch_data.h
index f4db3306..e7ef0a8 100644
--- a/base/mac/scoped_launch_data.h
+++ b/base/mac/scoped_launch_data.h
@@ -9,6 +9,11 @@
 
 #include "base/scoped_generic.h"
 
+// This file uses launch_data_t and related APIs, which are deprecated with no
+// replacement.
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+
 namespace base {
 namespace mac {
 
@@ -28,4 +33,6 @@
 }  // namespace mac
 }  // namespace base
 
+#pragma clang diagnostic pop  // -Wdeprecated-declarations
+
 #endif  // BASE_MAC_SCOPED_LAUNCH_DATA_H_
diff --git a/build/config/mac/mac_sdk.gni b/build/config/mac/mac_sdk.gni
index 544c524..1a6d170 100644
--- a/build/config/mac/mac_sdk.gni
+++ b/build/config/mac/mac_sdk.gni
@@ -14,7 +14,7 @@
   # additional code changes are required to be compliant with the availability
   # rules.
   # Must be of the form x.x.x for Info.plist files.
-  mac_deployment_target = "10.9.0"
+  mac_deployment_target = "10.10.0"
 
   # The value of the LSMinimmumSystemVersion in Info.plist files. This partially
   # controls the minimum supported version of macOS for Chromium by
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm
index 26d3bd7..7b78848 100644
--- a/chrome/browser/app_controller_mac.mm
+++ b/chrome/browser/app_controller_mac.mm
@@ -826,10 +826,15 @@
   waitTitle =
       l10n_util::GetNSString(IDS_ABANDON_DOWNLOAD_DIALOG_CONTINUE_BUTTON);
 
+  base::scoped_nsobject<NSAlert> alert([[NSAlert alloc] init]);
+  [alert setMessageText:titleText];
+  [alert setInformativeText:explanationText];
+  [alert addButtonWithTitle:waitTitle];
+  [alert addButtonWithTitle:exitTitle];
+
   // 'waitButton' is the default choice.
-  int choice = NSRunAlertPanel(titleText, @"%@",
-                               waitTitle, exitTitle, nil, explanationText);
-  return choice == NSAlertDefaultReturn ? YES : NO;
+  int choice = [alert runModal];
+  return choice == NSAlertFirstButtonReturn ? YES : NO;
 }
 
 // Check all profiles for in progress downloads, and if we find any, prompt the
diff --git a/chrome/browser/media/router/discovery/discovery_network_list_wifi_mac.mm b/chrome/browser/media/router/discovery/discovery_network_list_wifi_mac.mm
index b21b5da..4061066 100644
--- a/chrome/browser/media/router/discovery/discovery_network_list_wifi_mac.mm
+++ b/chrome/browser/media/router/discovery/discovery_network_list_wifi_mac.mm
@@ -12,6 +12,12 @@
 #include "base/logging.h"
 #include "base/strings/sys_string_conversions.h"
 
+// TODO(crbug.com/841631): This file uses the deprecated CWInterface interface;
+// it needs to be migrated to CWWiFiClient, which is unfortunately not
+// compatible.
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+
 namespace media_router {
 namespace {
 
@@ -42,3 +48,5 @@
 }
 
 }  // namespace media_router
+
+#pragma clang diagnostic pop
diff --git a/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac_unittest.mm b/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac_unittest.mm
index 14eae35..3cac8b3 100644
--- a/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac_unittest.mm
+++ b/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac_unittest.mm
@@ -116,8 +116,11 @@
 
 - (id)init:(NSString*)name {
   if ((self = [super init])) {
+    base::scoped_nsobject<NSDateFormatter> iso8601day(
+        [[NSDateFormatter alloc] init]);
+    [iso8601day setDateFormat:@"yyyy-MM-dd"];
     name_.reset([name retain]);
-    date_.reset([[NSDate dateWithNaturalLanguageString:@"12/12/12"] retain]);
+    date_.reset([[iso8601day dateFromString:@"2012-12-12"] retain]);
   }
   return self;
 }
diff --git a/chrome/browser/shell_integration_mac.mm b/chrome/browser/shell_integration_mac.mm
index 7474507..7d0b430 100644
--- a/chrome/browser/shell_integration_mac.mm
+++ b/chrome/browser/shell_integration_mac.mm
@@ -121,17 +121,14 @@
 base::string16 GetApplicationNameForProtocol(const GURL& url) {
   NSURL* ns_url = [NSURL URLWithString:
       base::SysUTF8ToNSString(url.possibly_invalid_spec())];
-  CFURLRef openingApp = NULL;
-  OSStatus status = LSGetApplicationForURL((CFURLRef)ns_url,
-                                           kLSRolesAll,
-                                           NULL,
-                                           &openingApp);
-  if (status != noErr) {
+  base::ScopedCFTypeRef<CFErrorRef> out_err;
+  base::ScopedCFTypeRef<CFURLRef> openingApp(LSCopyDefaultApplicationURLForURL(
+      (CFURLRef)ns_url, kLSRolesAll, out_err.InitializeInto()));
+  if (out_err) {
     // likely kLSApplicationNotFoundErr
     return base::string16();
   }
-  NSString* appPath = [(NSURL*)openingApp path];
-  CFRelease(openingApp);  // NOT A BUG; LSGetApplicationForURL retains for us
+  NSString* appPath = [base::mac::CFToNSCast(openingApp.get()) path];
   NSString* appDisplayName =
       [[NSFileManager defaultManager] displayNameAtPath:appPath];
   return base::SysNSStringToUTF16(appDisplayName);
diff --git a/chrome/browser/ui/cocoa/touchbar/browser_window_default_touch_bar.mm b/chrome/browser/ui/cocoa/touchbar/browser_window_default_touch_bar.mm
index 2bcd809..490da56 100644
--- a/chrome/browser/ui/cocoa/touchbar/browser_window_default_touch_bar.mm
+++ b/chrome/browser/ui/cocoa/touchbar/browser_window_default_touch_bar.mm
@@ -407,6 +407,11 @@
   return touchBar.autorelease();
 }
 
+// TODO(crbug.com/921109): Migrate to the new NSAccessibility API for this
+// method.
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+
 - (void)setupBackForwardControl {
   NSMutableArray* images = [NSMutableArray arrayWithArray:@[
     CreateNSImageFromIcon(vector_icons::kBackArrowIcon),
@@ -451,6 +456,8 @@
   backForwardControl_.reset([control retain]);
 }
 
+#pragma clang diagnostic pop
+
 - (void)updateWebContents:(content::WebContents*)contents {
   notificationBridge_->UpdateWebContents(contents);
 }
diff --git a/chrome/browser/web_applications/components/web_app_shortcut_mac.mm b/chrome/browser/web_applications/components/web_app_shortcut_mac.mm
index 6751a33..376544a 100644
--- a/chrome/browser/web_applications/components/web_app_shortcut_mac.mm
+++ b/chrome/browser/web_applications/components/web_app_shortcut_mac.mm
@@ -935,17 +935,8 @@
       base::SysUTF8ToCFStringRef(GetBundleIdentifier()));
 
   // Retrieve the URLs found by LaunchServices.
-  base::scoped_nsobject<NSArray> urls;
-  if (@available(macOS 10.10, *)) {
-    urls.reset(base::mac::CFToNSCast(
-        LSCopyApplicationURLsForBundleIdentifier(bundle_id_cf.get(), nullptr)));
-  } else {
-    base::ScopedCFTypeRef<CFURLRef> cf_url;
-    LSFindApplicationForInfo(kLSUnknownCreator, bundle_id_cf.get(), NULL, NULL,
-                             cf_url.InitializeInto());
-    if (cf_url)
-      urls.reset([@[ base::mac::CFToNSCast(cf_url) ] retain]);
-  }
+  base::scoped_nsobject<NSArray> urls(base::mac::CFToNSCast(
+      LSCopyApplicationURLsForBundleIdentifier(bundle_id_cf.get(), nullptr)));
 
   // Store only those results corresponding to this user data dir.
   std::vector<base::FilePath> paths;
diff --git a/chrome/common/importer/firefox_importer_utils_mac.mm b/chrome/common/importer/firefox_importer_utils_mac.mm
index ac9cf41..1152a56 100644
--- a/chrome/common/importer/firefox_importer_utils_mac.mm
+++ b/chrome/common/importer/firefox_importer_utils_mac.mm
@@ -25,17 +25,17 @@
 }
 
 base::FilePath GetFirefoxDylibPath() {
-  CFURLRef appURL = nil;
-  if (LSFindApplicationForInfo(kLSUnknownCreator,
-                              CFSTR("org.mozilla.firefox"),
-                              NULL,
-                              NULL,
-                              &appURL) != noErr) {
+  base::ScopedCFTypeRef<CFErrorRef> out_err;
+  base::ScopedCFTypeRef<CFArrayRef> app_urls(
+      LSCopyApplicationURLsForBundleIdentifier(CFSTR("org.mozilla.firefox"),
+                                               out_err.InitializeInto()));
+  if (out_err || CFArrayGetCount(app_urls) == 0) {
     return base::FilePath();
   }
-  NSBundle *ff_bundle =
-      [NSBundle bundleWithPath:[base::mac::CFToNSCast(appURL) path]];
-  CFRelease(appURL);
+  CFURLRef app_url =
+      base::mac::CFCastStrict<CFURLRef>(CFArrayGetValueAtIndex(app_urls, 0));
+  NSBundle* ff_bundle =
+      [NSBundle bundleWithPath:[base::mac::CFToNSCast(app_url) path]];
   NSString *ff_library_path =
       [[ff_bundle executablePath] stringByDeletingLastPathComponent];
   char buf[MAXPATHLEN];
diff --git a/chrome/common/mac/service_management.mm b/chrome/common/mac/service_management.mm
index 52dbdd6..5861c7c 100644
--- a/chrome/common/mac/service_management.mm
+++ b/chrome/common/mac/service_management.mm
@@ -17,6 +17,11 @@
 #include "base/macros.h"
 #include "base/strings/sys_string_conversions.h"
 
+// This entire file is written in terms of the launch_data_t API, which is
+// deprecated with no replacement, so just ignore the warnings for now.
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+
 namespace {
 
 class ScopedLaunchData {
@@ -260,3 +265,5 @@
 
 }  // namespace services
 }  // namespace mac
+
+#pragma clang diagnostic pop
diff --git a/components/download/quarantine/common_mac.h b/components/download/quarantine/common_mac.h
index 3d51b1c..179bb13 100644
--- a/components/download/quarantine/common_mac.h
+++ b/components/download/quarantine/common_mac.h
@@ -15,10 +15,6 @@
 
 namespace download {
 
-bool GetQuarantinePropertiesDeprecated(
-    const base::FilePath& file,
-    base::scoped_nsobject<NSMutableDictionary>* properties);
-
 bool GetQuarantineProperties(
     const base::FilePath& file,
     base::scoped_nsobject<NSMutableDictionary>* properties);
diff --git a/components/download/quarantine/common_mac.mm b/components/download/quarantine/common_mac.mm
index 3682e0a..a8ccaeb 100644
--- a/components/download/quarantine/common_mac.mm
+++ b/components/download/quarantine/common_mac.mm
@@ -17,46 +17,6 @@
 
 namespace download {
 
-// Once Chrome no longer supports macOS 10.9, this code will no longer be
-// necessary. Note that LSCopyItemAttribute was deprecated in macOS 10.8, but
-// the replacement to kLSItemQuarantineProperties did not exist until macOS
-// 10.10.
-#if !defined(MAC_OS_X_VERSION_10_10) || \
-    MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_10
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-bool GetQuarantinePropertiesDeprecated(
-    const base::FilePath& file,
-    base::scoped_nsobject<NSMutableDictionary>* properties) {
-  const UInt8* path = reinterpret_cast<const UInt8*>(file.value().c_str());
-  FSRef file_ref;
-  if (FSPathMakeRef(path, &file_ref, nullptr) != noErr)
-    return false;
-
-  base::ScopedCFTypeRef<CFTypeRef> quarantine_properties;
-  OSStatus status =
-      LSCopyItemAttribute(&file_ref, kLSRolesAll, kLSItemQuarantineProperties,
-                          quarantine_properties.InitializeInto());
-  if (status != noErr)
-    return true;
-
-  CFDictionaryRef quarantine_properties_dict =
-      base::mac::CFCast<CFDictionaryRef>(quarantine_properties.get());
-  if (!quarantine_properties_dict) {
-    LOG(WARNING) << "kLSItemQuarantineProperties is not a dictionary on file "
-                 << file.value();
-    return false;
-  }
-
-  properties->reset(
-      [base::mac::CFToNSCast(quarantine_properties_dict) mutableCopy]);
-  return true;
-}
-
-#pragma clang diagnostic pop
-#endif
-
-API_AVAILABLE(macos(10.10))
 bool GetQuarantineProperties(
     const base::FilePath& file,
     base::scoped_nsobject<NSMutableDictionary>* properties) {
diff --git a/components/download/quarantine/quarantine_mac.mm b/components/download/quarantine/quarantine_mac.mm
index b4a3341..c43cac8 100644
--- a/components/download/quarantine/quarantine_mac.mm
+++ b/components/download/quarantine/quarantine_mac.mm
@@ -23,34 +23,6 @@
 
 namespace {
 
-// Once Chrome no longer supports macOS 10.9, this code will no longer be
-// necessary. Note that LSCopyItemAttribute was deprecated in macOS 10.8, but
-// the replacement to kLSItemQuarantineProperties did not exist until macOS
-// 10.10.
-#if !defined(MAC_OS_X_VERSION_10_10) || \
-    MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_10
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-bool SetQuarantinePropertiesDeprecated(const base::FilePath& file,
-                                       NSDictionary* properties) {
-  const UInt8* path = reinterpret_cast<const UInt8*>(file.value().c_str());
-  FSRef file_ref;
-  if (FSPathMakeRef(path, &file_ref, nullptr) != noErr)
-    return false;
-
-  OSStatus os_error = LSSetItemAttribute(
-      &file_ref, kLSRolesAll, kLSItemQuarantineProperties, properties);
-  if (os_error != noErr) {
-    OSSTATUS_LOG(WARNING, os_error)
-        << "Unable to set quarantine attributes on file " << file.value();
-    return false;
-  }
-  return true;
-}
-#pragma clang diagnostic pop
-#endif
-
-API_AVAILABLE(macos(10.10))
 bool SetQuarantineProperties(const base::FilePath& file,
                              NSDictionary* properties) {
   base::scoped_nsobject<NSURL> file_url([[NSURL alloc]
@@ -170,12 +142,7 @@
                                  const GURL& referrer) {
   base::ScopedBlockingCall scoped_blocking_call(base::BlockingType::MAY_BLOCK);
   base::scoped_nsobject<NSMutableDictionary> properties;
-  bool success = false;
-  if (@available(macos 10.10, *)) {
-    success = GetQuarantineProperties(file, &properties);
-  } else {
-    success = GetQuarantinePropertiesDeprecated(file, &properties);
-  }
+  bool success = GetQuarantineProperties(file, &properties);
 
   if (!success)
     return false;
@@ -213,11 +180,7 @@
     [properties setValue:origin_url forKey:(NSString*)kLSQuarantineDataURLKey];
   }
 
-  if (@available(macos 10.10, *)) {
-    return SetQuarantineProperties(file, properties);
-  } else {
-    return SetQuarantinePropertiesDeprecated(file, properties);
-  }
+  return SetQuarantineProperties(file, properties);
 }
 
 }  // namespace
diff --git a/components/download/quarantine/test_support_mac.mm b/components/download/quarantine/test_support_mac.mm
index a1ebbd6..7158aba 100644
--- a/components/download/quarantine/test_support_mac.mm
+++ b/components/download/quarantine/test_support_mac.mm
@@ -26,11 +26,7 @@
     return false;
 
   base::scoped_nsobject<NSMutableDictionary> properties;
-  bool success = false;
-  if (@available(macos 10.10, *))
-    success = GetQuarantineProperties(file, &properties);
-  else
-    success = GetQuarantinePropertiesDeprecated(file, &properties);
+  bool success = GetQuarantineProperties(file, &properties);
 
   if (!success || !properties)
     return false;
diff --git a/components/storage_monitor/image_capture_device_manager_unittest.mm b/components/storage_monitor/image_capture_device_manager_unittest.mm
index 02e1726..df88619 100644
--- a/components/storage_monitor/image_capture_device_manager_unittest.mm
+++ b/components/storage_monitor/image_capture_device_manager_unittest.mm
@@ -157,8 +157,11 @@
 
 - (instancetype)init:(NSString*)name {
   if ((self = [super init])) {
+    base::scoped_nsobject<NSDateFormatter> iso8601day(
+        [[NSDateFormatter alloc] init]);
+    [iso8601day setDateFormat:@"yyyy-MM-dd"];
     name_.reset([name retain]);
-    date_.reset([[NSDate dateWithNaturalLanguageString:@"12/12/12"] retain]);
+    date_.reset([[iso8601day dateFromString:@"2012-12-12"] retain]);
   }
   return self;
 }
diff --git a/components/wifi/wifi_service_mac.mm b/components/wifi/wifi_service_mac.mm
index 4f46e1c..ad40c2a 100644
--- a/components/wifi/wifi_service_mac.mm
+++ b/components/wifi/wifi_service_mac.mm
@@ -165,7 +165,7 @@
 void WiFiServiceMac::Initialize(
   scoped_refptr<base::SequencedTaskRunner> task_runner) {
   task_runner_.swap(task_runner);
-  interface_.reset([[CWInterface interface] retain]);
+  interface_.reset([[[CWWiFiClient sharedWiFiClient] interface] retain]);
   if (!interface_) {
     DVLOG(1) << "Failed to initialize default interface.";
     return;
diff --git a/content/browser/accessibility/accessibility_tree_formatter_mac.mm b/content/browser/accessibility/accessibility_tree_formatter_mac.mm
index 28d76d87..2f36e17b 100644
--- a/content/browser/accessibility/accessibility_tree_formatter_mac.mm
+++ b/content/browser/accessibility/accessibility_tree_formatter_mac.mm
@@ -17,6 +17,11 @@
 #include "content/browser/accessibility/browser_accessibility_mac.h"
 #include "content/browser/accessibility/browser_accessibility_manager.h"
 
+// This file uses the deprecated NSObject accessibility interface.
+// TODO(crbug.com/921109): Migrate to the new NSAccessibility interface.
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+
 using base::StringPrintf;
 using base::SysNSStringToUTF8;
 using base::SysNSStringToUTF16;
@@ -361,3 +366,5 @@
 }
 
 }  // namespace content
+
+#pragma clang diagnostic pop
diff --git a/content/browser/accessibility/browser_accessibility_cocoa.mm b/content/browser/accessibility/browser_accessibility_cocoa.mm
index 9e5070b..d1e7164 100644
--- a/content/browser/accessibility/browser_accessibility_cocoa.mm
+++ b/content/browser/accessibility/browser_accessibility_cocoa.mm
@@ -2787,6 +2787,11 @@
   return actions;
 }
 
+// TODO(crbug.com/921109): Migrate from the NSObject accessibility interface to
+// the NSAccessibility one, then remove this suppression.
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+
 // Returns a sub-array of values for the given attribute value, starting at
 // index, with up to maxCount items.  If the given index is out of bounds,
 // or there are no values for the given attribute, it will return nil.
@@ -2823,6 +2828,8 @@
   return [fullArray count];
 }
 
+#pragma clang diagnostic pop
+
 // Returns the list of accessibility attributes that this object supports.
 - (NSArray*)accessibilityAttributeNames {
   if (![self instanceActive])
diff --git a/content/browser/accessibility/browser_accessibility_cocoa_browsertest.mm b/content/browser/accessibility/browser_accessibility_cocoa_browsertest.mm
index 8c0e74b..7ca5a1a 100644
--- a/content/browser/accessibility/browser_accessibility_cocoa_browsertest.mm
+++ b/content/browser/accessibility/browser_accessibility_cocoa_browsertest.mm
@@ -19,6 +19,11 @@
 #include "testing/gtest_mac.h"
 #include "url/gurl.h"
 
+// This file uses the deprecated NSObject accessibility APIs:
+// https://crbug.com/921109
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+
 namespace content {
 
 namespace {
@@ -119,3 +124,5 @@
 }
 
 }  // namespace content
+
+#pragma clang diagnostic pop
diff --git a/content/browser/accessibility/browser_accessibility_mac_unittest.mm b/content/browser/accessibility/browser_accessibility_mac_unittest.mm
index cbfcdad..3c611af 100644
--- a/content/browser/accessibility/browser_accessibility_mac_unittest.mm
+++ b/content/browser/accessibility/browser_accessibility_mac_unittest.mm
@@ -123,6 +123,11 @@
   std::unique_ptr<BrowserAccessibilityManager> manager_;
 };
 
+// The next few tests all use the deprecated NSObject accessibility APIs:
+// https://crbug.com/921109.
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+
 // Standard hit test.
 TEST_F(BrowserAccessibilityMacTest, HitTestTest) {
   BrowserAccessibilityCocoa* firstChild =
@@ -186,6 +191,8 @@
   [retainedFirstChild release];
 }
 
+#pragma clang diagnostic pop
+
 TEST_F(BrowserAccessibilityMacTest, TestComputeTextEdit) {
   BrowserAccessibility* owner = [accessibility_ owner];
   ASSERT_NE(nullptr, owner);
diff --git a/content/browser/renderer_host/render_widget_host_view_cocoa.mm b/content/browser/renderer_host/render_widget_host_view_cocoa.mm
index 57a608c..673c7da 100644
--- a/content/browser/renderer_host/render_widget_host_view_cocoa.mm
+++ b/content/browser/renderer_host/render_widget_host_view_cocoa.mm
@@ -1381,6 +1381,11 @@
   return client_;
 }
 
+// TODO(crbug.com/921109): Migrate from the NSObject accessibility API to the
+// NSAccessibility API, then remove this suppression.
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+
 - (NSArray*)accessibilityArrayAttributeValues:(NSString*)attribute
                                         index:(NSUInteger)index
                                      maxCount:(NSUInteger)maxCount {
@@ -1451,6 +1456,8 @@
   return clientHelper_->GetFocusedBrowserAccessibilityElement();
 }
 
+#pragma clang diagnostic pop
+
 // Below is our NSTextInputClient implementation.
 //
 // When WebHTMLView receives a NSKeyDown event, WebHTMLView calls the following
diff --git a/content/browser/web_contents/web_contents_view_mac_unittest.mm b/content/browser/web_contents/web_contents_view_mac_unittest.mm
index 17786bc..cf322960 100644
--- a/content/browser/web_contents/web_contents_view_mac_unittest.mm
+++ b/content/browser/web_contents/web_contents_view_mac_unittest.mm
@@ -39,6 +39,10 @@
       [view draggingSourceOperationMaskForLocal:NO]);
 }
 
+// This test uses deprecated NSObject accessibility APIs - see
+// https://crbug.com/921109.
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
 TEST_F(WebContentsViewCocoaTest, AccessibilityParentTest) {
   // The designated initializer is private but init should be fine in this case.
   base::scoped_nsobject<WebContentsViewCocoa> view(
@@ -60,6 +64,7 @@
   EXPECT_NSEQ([view accessibilityAttributeValue:NSAccessibilityParentAttribute],
               parent_view);
 }
+#pragma clang diagnostic pop
 
 namespace {
 
diff --git a/content/shell/browser/shell_javascript_dialog_mac.mm b/content/shell/browser/shell_javascript_dialog_mac.mm
index 096d2e7..d77829d 100644
--- a/content/shell/browser/shell_javascript_dialog_mac.mm
+++ b/content/shell/browser/shell_javascript_dialog_mac.mm
@@ -26,9 +26,8 @@
    andCallback:(content::JavaScriptDialogManager::DialogClosedCallback)callback;
 - (NSAlert*)alert;
 - (NSTextField*)textField;
-- (void)alertDidEnd:(NSAlert*)alert
-         returnCode:(int)returnCode
-        contextInfo:(void*)contextInfo;
+- (void)alertDidEndWithResult:(NSModalResponse)returnCode
+                       dialog:(content::ShellJavaScriptDialog*)dialog;
 - (void)cancel;
 
 @end
@@ -60,10 +59,9 @@
   return textField_;
 }
 
-- (void)alertDidEnd:(NSAlert*)alert
-         returnCode:(int)returnCode
-        contextInfo:(void*)contextInfo {
-  if (returnCode == NSRunStoppedResponse)
+- (void)alertDidEndWithResult:(NSModalResponse)returnCode
+                       dialog:(content::ShellJavaScriptDialog*)dialog {
+  if (returnCode == NSModalResponseStop)
     return;
 
   bool success = returnCode == NSAlertFirstButtonReturn;
@@ -71,10 +69,8 @@
   if (textField_)
     input = base::SysNSStringToUTF16([textField_ stringValue]);
 
-  content::ShellJavaScriptDialog* native_dialog =
-      reinterpret_cast<content::ShellJavaScriptDialog*>(contextInfo);
   std::move(callback_).Run(success, input);
-  manager_->DialogClosed(native_dialog);
+  manager_->DialogClosed(dialog);
 }
 
 - (void)cancel {
@@ -117,11 +113,10 @@
     [other setKeyEquivalent:@"\e"];
   }
 
-  [alert
-      beginSheetModalForWindow:nil  // nil here makes it app-modal
-                 modalDelegate:helper_
-                didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:)
-                   contextInfo:this];
+  [alert beginSheetModalForWindow:nil  // nil here makes it app-modal
+                completionHandler:^void(NSModalResponse returnCode) {
+                  [helper_ alertDidEndWithResult:returnCode dialog:this];
+                }];
 }
 
 ShellJavaScriptDialog::~ShellJavaScriptDialog() {
diff --git a/content/shell/browser/shell_login_dialog_mac.mm b/content/shell/browser/shell_login_dialog_mac.mm
index 695f8bbd..647b3b7 100644
--- a/content/shell/browser/shell_login_dialog_mac.mm
+++ b/content/shell/browser/shell_login_dialog_mac.mm
@@ -31,9 +31,8 @@
 
 - (NSAlert*)alert;
 - (NSView*)accessoryView;
-- (void)alertDidEnd:(NSAlert*)alert
-         returnCode:(int)returnCode
-        contextInfo:(void*)contextInfo;
+- (void)alertDidEndWithResponse:(NSModalResponse)response
+                         dialog:(content::ShellLoginDialog*)dialog;
 - (void)cancel;
 
 @end
@@ -57,20 +56,17 @@
   return accessory_view;
 }
 
-- (void)alertDidEnd:(NSAlert*)alert
-         returnCode:(int)returnCode
-        contextInfo:(void*)contextInfo {
-  if (returnCode == NSRunStoppedResponse)
+- (void)alertDidEndWithResponse:(NSModalResponse)returnCode
+                         dialog:(content::ShellLoginDialog*)dialog {
+  if (returnCode == NSModalResponseStop)
     return;
 
-  content::ShellLoginDialog* this_dialog =
-      reinterpret_cast<content::ShellLoginDialog*>(contextInfo);
   if (returnCode == NSAlertFirstButtonReturn) {
-    this_dialog->UserAcceptedAuth(
+    dialog->UserAcceptedAuth(
         base::SysNSStringToUTF16([usernameField_ stringValue]),
         base::SysNSStringToUTF16([passwordField_ stringValue]));
   } else {
-    this_dialog->UserCancelledAuth();
+    dialog->UserCancelledAuth();
   }
 }
 
@@ -95,11 +91,10 @@
   [alert addButtonWithTitle:@"OK"];
   NSButton* other = [alert addButtonWithTitle:@"Cancel"];
   [other setKeyEquivalent:@"\e"];
-  [alert
-      beginSheetModalForWindow:nil  // nil here makes it app-modal
-                 modalDelegate:helper_
-                didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:)
-                   contextInfo:this];
+  [alert beginSheetModalForWindow:nil
+                completionHandler:^void(NSModalResponse resp) {
+                  [helper_ alertDidEndWithResponse:resp dialog:this];
+                }];
 }
 
 void ShellLoginDialog::PlatformCleanUp() {
diff --git a/remoting/host/installer/mac/BUILD.gn b/remoting/host/installer/mac/BUILD.gn
index f4b1357..357b1f5 100644
--- a/remoting/host/installer/mac/BUILD.gn
+++ b/remoting/host/installer/mac/BUILD.gn
@@ -141,6 +141,7 @@
     "//base",
     "//remoting/host:remoting_infoplist_strings",
     "//remoting/host/mac:constants",
+    "//ui/base:base",
   ]
   foreach(locale, remoting_locales_with_underscores) {
     deps += [ ":remoting_uninstaller_strings_${locale}_bundle_data" ]
diff --git a/remoting/host/installer/mac/uninstaller/remoting_uninstaller_app.mm b/remoting/host/installer/mac/uninstaller/remoting_uninstaller_app.mm
index cf22a9b..7724eb5 100644
--- a/remoting/host/installer/mac/uninstaller/remoting_uninstaller_app.mm
+++ b/remoting/host/installer/mac/uninstaller/remoting_uninstaller_app.mm
@@ -6,7 +6,10 @@
 
 #import <Cocoa/Cocoa.h>
 
+#include "base/mac/scoped_nsobject.h"
+#include "remoting/base/string_resources.h"
 #include "remoting/host/installer/mac/uninstaller/remoting_uninstaller.h"
+#include "ui/base/l10n/l10n_util_mac.h"
 
 @implementation RemotingUninstallerAppDelegate
 
@@ -19,13 +22,12 @@
 
 - (void)showSuccess:(bool)success withMessage:(NSString*) message {
   NSString* summary = success ? @"Uninstall succeeded" : @"Uninstall failed";
-  NSAlert* alert = [NSAlert alertWithMessageText:summary
-                                   defaultButton:@"OK"
-                                 alternateButton:nil
-                                     otherButton:nil
-                       informativeTextWithFormat:@"%@", message];
-  [alert setAlertStyle:
-       (success ? NSInformationalAlertStyle : NSCriticalAlertStyle)];
+  base::scoped_nsobject<NSAlert> alert([[NSAlert alloc] init]);
+  [alert setMessageText:summary];
+  [alert setInformativeText:message];
+  [alert setAlertStyle:(success ? NSInformationalAlertStyle
+                                : NSCriticalAlertStyle)];
+  [alert addButtonWithTitle:l10n_util::GetNSString(IDS_OK)];
   [alert runModal];
 }
 
diff --git a/services/device/geolocation/wifi_data_provider_mac.mm b/services/device/geolocation/wifi_data_provider_mac.mm
index ff25310..278a538 100644
--- a/services/device/geolocation/wifi_data_provider_mac.mm
+++ b/services/device/geolocation/wifi_data_provider_mac.mm
@@ -7,6 +7,12 @@
 #import <CoreWLAN/CoreWLAN.h>
 #import <Foundation/Foundation.h>
 
+// This file uses the deprecated CWInterface API, but CWWiFiClient appears to be
+// different in ways that are relevant to this code, so for now ignore the
+// deprecation. See <https://crbug.com/841631>.
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+
 #include "base/mac/scoped_nsautorelease_pool.h"
 #include "base/mac/scoped_nsobject.h"
 #include "base/macros.h"
@@ -135,3 +141,5 @@
 }
 
 }  // namespace device
+
+#pragma clang diagnostic pop
diff --git a/testing/iossim/iossim.mm b/testing/iossim/iossim.mm
index eea905e..a6ac57b 100644
--- a/testing/iossim/iossim.mm
+++ b/testing/iossim/iossim.mm
@@ -306,11 +306,11 @@
                      forKey:@"TestingEnvironmentVariables"];
   [xctestrun setObject:testTargetName forKey:@"TestTargetName"];
 
-  NSString* error;
   NSData* data = [NSPropertyListSerialization
-      dataFromPropertyList:xctestrun
+      dataWithPropertyList:xctestrun
                     format:NSPropertyListXMLFormat_v1_0
-          errorDescription:&error];
+                   options:0
+                     error:nil];
   [data writeToFile:tempFilePath atomically:YES];
   XCRunTask* task = [[[XCRunTask alloc] initWithArguments:@[
     @"xcodebuild", @"-xctestrun", tempFilePath, @"-destination",
diff --git a/third_party/blink/renderer/platform/text/locale_mac.mm b/third_party/blink/renderer/platform/text/locale_mac.mm
index ff17c91..fdd237e 100644
--- a/third_party/blink/renderer/platform/text/locale_mac.mm
+++ b/third_party/blink/renderer/platform/text/locale_mac.mm
@@ -89,7 +89,8 @@
     : locale_(locale),
       gregorian_calendar_(
           kAdoptNS,
-          [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]),
+          [[NSCalendar alloc]
+              initWithCalendarIdentifier:NSCalendarIdentifierGregorian]),
       did_initialize_number_data_(false) {
   NSArray* available_languages = [NSLocale ISOLanguageCodes];
   // NSLocale returns a lower case NSLocaleLanguageCode so we don't have care
diff --git a/third_party/breakpad/BUILD.gn b/third_party/breakpad/BUILD.gn
index adfbe88..de3146a 100644
--- a/third_party/breakpad/BUILD.gn
+++ b/third_party/breakpad/BUILD.gn
@@ -455,6 +455,10 @@
     defines = [ "USE_PROTECTED_ALLOCATIONS=1" ]
     include_dirs = [ "breakpad/src/client/apple/Framework" ]
 
+    # TODO(crbug.com/841631): Breakpad uses bootstrap_subset() and
+    # bootstrap_create_server(), both of which are deprecated starting in 10.10.
+    cflags = [ "-Wno-deprecated-declarations" ]
+
     deps = [
       ":crash_inspector",
       ":crash_report_sender",
diff --git a/third_party/google_toolbox_for_mac/BUILD.gn b/third_party/google_toolbox_for_mac/BUILD.gn
index 67768b1..78ca06a 100644
--- a/third_party/google_toolbox_for_mac/BUILD.gn
+++ b/third_party/google_toolbox_for_mac/BUILD.gn
@@ -39,6 +39,11 @@
       "Cocoa.framework",
       "QuartzCore.framework",
     ]
+
+    # TODO(crbug.com/841631): GTM uses accessibility APIs that are deprecated as
+    # of 10.10. These can't yet be compiled out, so for now, ignore deprecated
+    # declarations in GTM altogether.
+    cflags = [ "-Wno-deprecated-declarations" ]
   } else {  # is_ios
     sources += [
       "src/DebugUtils/GTMMethodCheck.h",
diff --git a/third_party/mozilla/NSWorkspace+Utils.h b/third_party/mozilla/NSWorkspace+Utils.h
index 13096a9..a1ea48c1 100644
--- a/third_party/mozilla/NSWorkspace+Utils.h
+++ b/third_party/mozilla/NSWorkspace+Utils.h
@@ -43,16 +43,13 @@
 
 - (NSArray*)installedBrowserIdentifiers;    // sort order not specified
 - (NSString*)defaultBrowserIdentifier;
-- (NSURL*)defaultBrowserURL;
 
 - (NSArray*)installedFeedViewerIdentifiers;
 - (NSString*)defaultFeedViewerIdentifier;
-- (NSURL*)defaultFeedViewerURL;
 
 - (void)setDefaultBrowserWithIdentifier:(NSString*)bundleID;
 - (void)setDefaultFeedViewerWithIdentifier:(NSString*)bundleID;
 
-- (NSURL*)urlOfApplicationWithIdentifier:(NSString*)bundleID;
 - (NSString*)identifierForBundle:(NSURL*)inBundleURL;
 - (NSString*)displayNameForFile:(NSURL*)inFileURL;
 
diff --git a/third_party/mozilla/NSWorkspace+Utils.m b/third_party/mozilla/NSWorkspace+Utils.m
index f6aab2c..f4c4914 100644
--- a/third_party/mozilla/NSWorkspace+Utils.m
+++ b/third_party/mozilla/NSWorkspace+Utils.m
@@ -81,22 +81,6 @@
   return [(NSString*)LSCopyDefaultHandlerForURLScheme(CFSTR("feed")) autorelease];
 }
 
-- (NSURL*)defaultBrowserURL
-{
-  NSString* defaultBundleId = [self defaultBrowserIdentifier];
-  if (defaultBundleId)
-    return [self urlOfApplicationWithIdentifier:defaultBundleId];
-  return nil;
-}
-
-- (NSURL*)defaultFeedViewerURL
-{
-  NSString* defaultBundleId = [self defaultFeedViewerIdentifier];
-  if (defaultBundleId)
-    return [self urlOfApplicationWithIdentifier:defaultBundleId];
-  return nil;
-}
-
 - (void)setDefaultBrowserWithIdentifier:(NSString*)bundleID
 {
   LSSetDefaultHandlerForURLScheme(CFSTR("http"), (CFStringRef)bundleID);
@@ -110,17 +94,6 @@
   LSSetDefaultHandlerForURLScheme(CFSTR("feed"), (CFStringRef)bundleID);
 }
 
-- (NSURL*)urlOfApplicationWithIdentifier:(NSString*)bundleID
-{
-  if (!bundleID)
-    return nil;
-  NSURL* appURL = nil;
-  if (LSFindApplicationForInfo(kLSUnknownCreator, (CFStringRef)bundleID, NULL, NULL, (CFURLRef*)&appURL) == noErr)
-    return [appURL autorelease];
-
-  return nil;
-}
-
 - (NSString*)identifierForBundle:(NSURL*)inBundleURL
 {
   if (!inBundleURL) return nil;
diff --git a/third_party/mozilla/README.chromium b/third_party/mozilla/README.chromium
index 7a44e32..9ea000d 100644
--- a/third_party/mozilla/README.chromium
+++ b/third_party/mozilla/README.chromium
@@ -33,3 +33,6 @@
 - MOZILLA_EXPORT was added to some constants in NSPasteboard+Utils.h.
 - +[NSWorkspace(CaminoDefaultBrowserAdditions) isLeopardOrHigher] hidden since
   it relies on methods deprecated in 10.8 (and is unused in Chrome).
+- NSWorkspace(CaminoDefaultBrowserAdditions) methods defaultBrowserURL,
+  defaultFeedViewerURL, and urlOfApplicationWithIdentifier: removed since they
+  are unused in Chrome and rely on deprecated APIs as of 10.10.
diff --git a/ui/views/controls/tabbed_pane/tabbed_pane_accessibility_mac_unittest.mm b/ui/views/controls/tabbed_pane/tabbed_pane_accessibility_mac_unittest.mm
index 8f08e72..f2c79ed 100644
--- a/ui/views/controls/tabbed_pane/tabbed_pane_accessibility_mac_unittest.mm
+++ b/ui/views/controls/tabbed_pane/tabbed_pane_accessibility_mac_unittest.mm
@@ -13,6 +13,11 @@
 #include "ui/views/widget/widget.h"
 #import "testing/gtest_mac.h"
 
+// This file uses the deprecated NSObject accessibility API - see
+// https://crbug.com/921109.
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+
 namespace views {
 namespace test {
 
@@ -163,3 +168,5 @@
 
 }  // namespace test
 }  // namespace views
+
+#pragma clang diagnostic pop
diff --git a/ui/views/widget/ax_native_widget_mac_unittest.mm b/ui/views/widget/ax_native_widget_mac_unittest.mm
index 45e70d3..da25e8e 100644
--- a/ui/views/widget/ax_native_widget_mac_unittest.mm
+++ b/ui/views/widget/ax_native_widget_mac_unittest.mm
@@ -97,6 +97,11 @@
 
 constexpr char TestWidgetDelegate::kAccessibleWindowTitle[];
 
+// This test framework uses the deprecated NSObject accessibility APIs - see
+// https://crbug.com/921109.
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+
 class AXNativeWidgetMacTest : public test::WidgetTest {
  public:
   AXNativeWidgetMacTest() {}
@@ -927,3 +932,5 @@
 }
 
 }  // namespace views
+
+#pragma clang diagnostic pop
diff --git a/ui/views/widget/native_widget_mac_unittest.mm b/ui/views/widget/native_widget_mac_unittest.mm
index 9bcfb2c4..85370ab 100644
--- a/ui/views/widget/native_widget_mac_unittest.mm
+++ b/ui/views/widget/native_widget_mac_unittest.mm
@@ -701,6 +701,11 @@
   widget->CloseNow();
 }
 
+// This test uses the deprecated NSObject accessibility API - see
+// https://crbug.com/921109.
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+
 // Tests that an accessibility request from the system makes its way through to
 // a views::Label filling the window.
 TEST_F(NativeWidgetMacTest, AccessibilityIntegration) {
@@ -726,6 +731,8 @@
   widget->CloseNow();
 }
 
+#pragma clang diagnostic pop
+
 namespace {
 
 Widget* AttachPopupToNativeParent(NSWindow* native_parent) {
diff --git a/ui/views_bridge_mac/alert.mm b/ui/views_bridge_mac/alert.mm
index 328f51b..4868e71 100644
--- a/ui/views_bridge_mac/alert.mm
+++ b/ui/views_bridge_mac/alert.mm
@@ -209,7 +209,7 @@
     case NSAlertSecondButtonReturn:  // Cancel
       alertBridge_->SendResultAndDestroy(AlertDisposition::SECONDARY_BUTTON);
       break;
-    case NSRunStoppedResponse:  // Window was closed underneath us
+    case NSModalResponseStop:  // Window was closed underneath us
       alertBridge_->SendResultAndDestroy(AlertDisposition::CLOSE);
       break;
     default:
@@ -223,10 +223,15 @@
   NSAlert* alert = [self alert];
   [alert layout];
   [[alert window] recalculateKeyViewLoop];
+  // TODO(crbug.com/841631): Migrate to `[NSWindow
+  // beginSheetModalForWindow:completionHandler:]` instead.
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
   [alert beginSheetModalForWindow:nil  // nil here makes it app-modal
                     modalDelegate:self
                    didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:)
                       contextInfo:NULL];
+#pragma clang diagnostic pop
 }
 
 - (void)closeWindow {
diff --git a/ui/views_bridge_mac/bridged_native_widget_impl.mm b/ui/views_bridge_mac/bridged_native_widget_impl.mm
index 3190bf9..4b01329 100644
--- a/ui/views_bridge_mac/bridged_native_widget_impl.mm
+++ b/ui/views_bridge_mac/bridged_native_widget_impl.mm
@@ -1338,11 +1338,16 @@
   // Since |this| may destroy [window_ delegate], use |window_| itself as the
   // delegate, which will forward to ViewsNSWindowDelegate if |this| is still
   // alive (i.e. it has not set the window delegate to nil).
+  // TODO(crbug.com/841631): Migrate to `[NSWindow
+  // beginSheet:completionHandler:]` instead of this method.
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
   [NSApp beginSheet:window_
       modalForWindow:parent_window
        modalDelegate:window_
       didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:)
          contextInfo:nullptr];
+#pragma clang diagnostic pop
 }
 
 }  // namespace views