electron/shell/browser/notifications/mac/cocoa_notification.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

46 lines
1.3 KiB
C
Raw Normal View History

2015-12-24 13:55:18 +00:00
// Copyright (c) 2015 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ELECTRON_SHELL_BROWSER_NOTIFICATIONS_MAC_COCOA_NOTIFICATION_H_
#define ELECTRON_SHELL_BROWSER_NOTIFICATIONS_MAC_COCOA_NOTIFICATION_H_
2015-12-24 13:55:18 +00:00
#import <Foundation/Foundation.h>
2018-01-16 05:07:27 +00:00
#include <map>
#include <string>
#include "shell/browser/notifications/notification.h"
2015-12-24 13:55:18 +00:00
namespace electron {
2015-12-24 13:55:18 +00:00
2015-12-24 14:06:41 +00:00
class CocoaNotification : public Notification {
2015-12-24 13:55:18 +00:00
public:
CocoaNotification(NotificationDelegate* delegate,
NotificationPresenter* presenter);
~CocoaNotification() override;
2015-12-24 13:55:18 +00:00
2015-12-25 03:05:48 +00:00
// Notification:
2017-06-24 11:03:27 +00:00
void Show(const NotificationOptions& options) override;
void Dismiss() override;
2015-12-24 13:55:18 +00:00
void NotificationDisplayed();
2017-05-31 07:17:29 +00:00
void NotificationReplied(const std::string& reply);
2018-01-17 03:07:54 +00:00
void NotificationActivated();
void NotificationActivated(NSUserNotificationAction* action);
void NotificationDismissed();
2015-12-24 13:55:18 +00:00
NSUserNotification* notification() const { return notification_; }
2015-12-24 13:55:18 +00:00
private:
void LogAction(const char* action);
chore: bump chromium to 117.0.5923.0 (main) (#39304) * chore: bump chromium in DEPS to 117.0.5921.0 * chore: update chromium patches * 4721409: Remove redundant ARC configuration in /components | https://chromium-review.googlesource.com/c/chromium/src/+/4721409 * 4643750: Add V8_LOW_PRIORITY_TQ for main thread | https://chromium-review.googlesource.com/c/chromium/src/+/4643750 * 4022621: Re-register status item when owner of status watcher is changed | https://chromium-review.googlesource.com/c/chromium/src/+/4022621 * chore: update V8/boringssl patches * fixup! 4643750: Add V8_LOW_PRIORITY_TQ for main thread | https://chromium-review.googlesource.com/c/chromium/src/+/4643750 * chore: bump chromium in DEPS to 117.0.5923.0 * build [debug]: remove assert 4722125: Update enterprise content analysis buildflags usage | https://chromium-review.googlesource.com/c/chromium/src/+/4722125 * chore: manually rollback to 117.0.5921.0 * build [arc]: ARC conversion in auto_updater * build [arc]: ARC conversion in browser/api * build [arc]: ARC conversion in notifications/mac * build [arc]: ARC conversion in in_app_purchase * build [arc]: ARC conversion in browser/ui * build [arc]: ARC conversion in ui/cocoa * build [arc]: ARC conversion in shell/common * build [arc]: ARC conversion in OSR * build [arc]: ARC conversion in login_helper * build [arc]: ARC conversion in app_mas * build [arc]: fix up ARC syntax (thanks @codebytere!) * 4726946: [Extensions] Work around dangling BrowserContext pointer. | https://chromium-review.googlesource.com/c/chromium/src/+/4726946 --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Keeley Hammond <vertedinde@electronjs.org> Co-authored-by: VerteDinde <keeleymhammond@gmail.com>
2023-08-04 08:47:29 +00:00
NSUserNotification* __strong notification_;
std::map<std::string, unsigned> additional_action_indices_;
unsigned action_index_;
2015-12-24 13:55:18 +00:00
};
} // namespace electron
2015-12-24 13:55:18 +00:00
#endif // ELECTRON_SHELL_BROWSER_NOTIFICATIONS_MAC_COCOA_NOTIFICATION_H_