blob: 39400b0d444e6ff1e1a367215ee6d96b7b14e475 [file]
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_SERVICES_MAC_NOTIFICATIONS_UNNOTIFICATION_METRICS_H_
#define CHROME_SERVICES_MAC_NOTIFICATIONS_UNNOTIFICATION_METRICS_H_
#import <Foundation/Foundation.h>
@class UNUserNotificationCenter;
namespace mac_notifications {
// This enum is used in UMA. Do not delete or re-order entries. New entries
// should only be added at the end.
enum class UNNotificationRequestPermissionResult {
kRequestFailed = 0,
kPermissionDenied = 1,
kPermissionGranted = 2,
kMaxValue = kPermissionGranted,
};
// This logs the result of asking for notification permissions on macOS. Called
// when we request notification permissions. This happens at startup for both
// banner and alert style notifications and at runtime when the mojo service
// starts up (e.g. when displaying a notification).
API_AVAILABLE(macosx(10.14))
void LogUNNotificationRequestPermissionResult(
UNNotificationRequestPermissionResult result);
// Requests and log the current notifications settings and permissions.
API_AVAILABLE(macosx(10.14))
void LogUNNotificationSettings(UNUserNotificationCenter* center);
} // namespace mac_notifications
#endif // CHROME_SERVICES_MAC_NOTIFICATIONS_UNNOTIFICATION_METRICS_H_