Added the flag #enable-new-mac-notification-api

This flag will be used to determine which notification API to run on macOS devices during the introduction of the new API.

Bug: None
Change-Id: Iddadbec08cea46d99a46cf425466420cdc38347d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2396076
Reviewed-by: Avi Drissman <[email protected]>
Reviewed-by: Richard Knoll <[email protected]>
Commit-Queue: Mohamed Adel <[email protected]>
Cr-Commit-Position: refs/heads/master@{#804936}
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 4c90f8f..78eedbcb 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -5816,6 +5816,13 @@
      FEATURE_VALUE_TYPE(features::kMacCoreLocationImplementation)},
 #endif
 
+#if defined(OS_MAC)
+    {"enable-new-mac-notification-api",
+     flag_descriptions::kNewMacNotificationAPIName,
+     flag_descriptions::kNewMacNotificationAPIDescription, kOsMac,
+     FEATURE_VALUE_TYPE(features::kNewMacNotificationAPI)},
+#endif
+
 #if defined(OS_CHROMEOS)
     {"exo-ordinal-motion", flag_descriptions::kExoOrdinalMotionName,
      flag_descriptions::kExoOrdinalMotionDescription, kOsCrOS,
diff --git a/chrome/browser/browser_features.cc b/chrome/browser/browser_features.cc
index b650f0c..e041b3d3 100644
--- a/chrome/browser/browser_features.cc
+++ b/chrome/browser/browser_features.cc
@@ -36,6 +36,12 @@
                                    base::FEATURE_DISABLED_BY_DEFAULT};
 #endif
 
+#if defined(OS_MAC)
+// Enables the usage of Apple's new Notification API on macOS 10.14+
+const base::Feature kNewMacNotificationAPI{"NewMacNotificationAPI",
+                                           base::FEATURE_DISABLED_BY_DEFAULT};
+#endif
+
 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
 // Enables taking snapshots of the user data directory after a major
 // milestone update and restoring them after a version rollback.
diff --git a/chrome/browser/browser_features.h b/chrome/browser/browser_features.h
index 8c563d7..5323d16 100644
--- a/chrome/browser/browser_features.h
+++ b/chrome/browser/browser_features.h
@@ -29,6 +29,10 @@
 extern const base::Feature kNearbySharing;
 #endif
 
+#if defined(OS_MAC)
+extern const base::Feature kNewMacNotificationAPI;
+#endif
+
 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
 extern const base::Feature kUserDataSnapshot;
 #endif
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json
index decf10f..2259a02 100644
--- a/chrome/browser/flag-metadata.json
+++ b/chrome/browser/flag-metadata.json
@@ -1818,6 +1818,11 @@
     "expiry_milestone": 89
   },
   {
+    "name": "enable-new-mac-notification-api",
+    "owners": [ "knollr", "peter", "[email protected]"],
+    "expiry_milestone": 90
+  },
+  {
     "name": "enable-new-profile-picker",
     "owners": [ "msalama" ],
     "expiry_milestone": 90
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
index 6c074df..e4f4cf8 100644
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -710,6 +710,12 @@
 const char kMacCoreLocationImplementationDescription[] =
     "Enables usage of the Core Location APIs on macOS for geolocation";
 
+const char kNewMacNotificationAPIName[] =
+    "Determines which notification API to use on macOS devices";
+const char kNewMacNotificationAPIDescription[] =
+    "Enables the usage of Apple's new notification API which will run on macOS "
+    "10.14+";
+
 const char kMaintainShelfStateWhenEnteringOverviewName[] =
     "Allow Home Launcher Shelf In Overview";
 const char kMaintainShelfStateWhenEnteringOverviewDescription[] =
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
index e21c061c..a8a80f11 100644
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -424,6 +424,9 @@
 extern const char kMacCoreLocationImplementationName[];
 extern const char kMacCoreLocationImplementationDescription[];
 
+extern const char kNewMacNotificationAPIName[];
+extern const char kNewMacNotificationAPIDescription[];
+
 extern const char kMaintainShelfStateWhenEnteringOverviewName[];
 extern const char kMaintainShelfStateWhenEnteringOverviewDescription[];