#ifndef UI_VIEWS_CONTROLS_MENU_MENU_COCOA_WATCHER_MAC_H_
#define UI_VIEWS_CONTROLS_MENU_MENU_COCOA_WATCHER_MAC_H_
#include <memory>
#include "base/functional/callback.h"
#include "ui/views/views_export.h"
namespace views {
enum class MacNotificationFilter {
DontIgnoreNotifications,
IgnoreWorkspaceNotifications,
IgnoreAllNotifications
};
class VIEWS_EXPORT MenuCocoaWatcherMac {
public:
static void SetNotificationFilterForTesting(MacNotificationFilter filter);
explicit MenuCocoaWatcherMac(base::OnceClosure callback);
MenuCocoaWatcherMac(const MenuCocoaWatcherMac&) = delete;
MenuCocoaWatcherMac& operator=(const MenuCocoaWatcherMac&) = delete;
~MenuCocoaWatcherMac();
void SetIgnoreWindowKeyNotificationOnce();
private:
void ExecuteCallback();
base::OnceClosure callback_;
struct ObjCStorage;
std::unique_ptr<ObjCStorage> objc_storage_;
bool ignore_window_key_notification_once_ = false;
};
}
#endif