2014-10-31 12:17:05 -06:00
|
|
|
// Copyright (c) 2013 GitHub, Inc.
|
2014-04-25 03:49:37 -06:00
|
|
|
// Use of this source code is governed by the MIT license that can be
|
2013-05-02 06:09:19 -06:00
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2021-11-22 00:34:31 -07:00
|
|
|
#ifndef ELECTRON_SHELL_BROWSER_MAC_ELECTRON_APPLICATION_H_
|
|
|
|
#define ELECTRON_SHELL_BROWSER_MAC_ELECTRON_APPLICATION_H_
|
2021-11-21 17:36:32 -07:00
|
|
|
|
2023-02-03 04:43:42 -07:00
|
|
|
#include "base/functional/callback.h"
|
2018-04-17 19:44:10 -06:00
|
|
|
#include "base/mac/scoped_sending_event.h"
|
2013-05-02 06:09:19 -06:00
|
|
|
|
2018-12-04 08:54:13 -07:00
|
|
|
#import <AVFoundation/AVFoundation.h>
|
2019-02-13 19:36:28 -07:00
|
|
|
#import <LocalAuthentication/LocalAuthentication.h>
|
2018-12-04 08:54:13 -07:00
|
|
|
|
2020-02-21 12:05:03 -07:00
|
|
|
@interface AtomApplication : NSApplication <CrAppProtocol,
|
|
|
|
CrAppControlProtocol,
|
|
|
|
NSUserActivityDelegate> {
|
2013-05-02 06:09:19 -06:00
|
|
|
@private
|
|
|
|
BOOL handlingSendEvent_;
|
2023-07-18 16:26:27 -06:00
|
|
|
NSUserActivity* __strong currentActivity_;
|
2017-09-14 01:12:34 -06:00
|
|
|
NSCondition* handoffLock_;
|
2017-08-09 09:09:47 -06:00
|
|
|
BOOL updateReceived_;
|
2020-06-15 19:58:28 -06:00
|
|
|
BOOL userStoppedShutdown_;
|
2021-05-06 16:01:04 -06:00
|
|
|
base::RepeatingCallback<bool()> shouldShutdown_;
|
2013-05-02 06:09:19 -06:00
|
|
|
}
|
|
|
|
|
2020-02-21 12:05:03 -07:00
|
|
|
+ (AtomApplication*)sharedApplication;
|
2013-05-30 02:03:10 -06:00
|
|
|
|
2021-05-06 16:01:04 -06:00
|
|
|
- (void)setShutdownHandler:(base::RepeatingCallback<bool()>)handler;
|
2019-10-10 09:54:03 -06:00
|
|
|
- (void)registerURLHandler;
|
2018-02-05 00:13:35 -07:00
|
|
|
|
2020-06-15 19:58:28 -06:00
|
|
|
// Called when macOS itself is shutting down.
|
|
|
|
- (void)willPowerOff:(NSNotification*)notify;
|
|
|
|
|
2013-05-02 06:09:19 -06:00
|
|
|
// CrAppProtocol:
|
|
|
|
- (BOOL)isHandlingSendEvent;
|
|
|
|
|
|
|
|
// CrAppControlProtocol:
|
|
|
|
- (void)setHandlingSendEvent:(BOOL)handlingSendEvent;
|
|
|
|
|
2019-02-25 10:21:57 -07:00
|
|
|
- (NSUserActivity*)getCurrentActivity;
|
2016-05-23 09:49:46 -06:00
|
|
|
- (void)setCurrentActivity:(NSString*)type
|
|
|
|
withUserInfo:(NSDictionary*)userInfo
|
|
|
|
withWebpageURL:(NSURL*)webpageURL;
|
2017-06-26 13:14:44 -06:00
|
|
|
- (void)invalidateCurrentActivity;
|
2019-06-06 23:16:03 -06:00
|
|
|
- (void)resignCurrentActivity;
|
2017-09-14 01:12:34 -06:00
|
|
|
- (void)updateCurrentActivity:(NSString*)type
|
2017-06-26 13:14:44 -06:00
|
|
|
withUserInfo:(NSDictionary*)userInfo;
|
2016-05-03 15:57:16 -06:00
|
|
|
|
2013-05-02 06:09:19 -06:00
|
|
|
@end
|
2021-11-21 17:36:32 -07:00
|
|
|
|
2021-11-22 00:34:31 -07:00
|
|
|
#endif // ELECTRON_SHELL_BROWSER_MAC_ELECTRON_APPLICATION_H_
|