2018-04-19 16:01:19 +09:00
|
|
|
// Copyright (c) 2018 GitHub, Inc.
|
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2021-11-22 08:34:31 +01:00
|
|
|
#ifndef ELECTRON_SHELL_BROWSER_UI_COCOA_ELECTRON_NS_WINDOW_DELEGATE_H_
|
|
|
|
#define ELECTRON_SHELL_BROWSER_UI_COCOA_ELECTRON_NS_WINDOW_DELEGATE_H_
|
2018-04-19 16:01:19 +09:00
|
|
|
|
2018-04-19 16:41:36 +09:00
|
|
|
#include <Quartz/Quartz.h>
|
|
|
|
|
2024-01-10 23:23:35 +01:00
|
|
|
#include <optional>
|
|
|
|
|
2023-06-13 14:45:48 -04:00
|
|
|
#include "base/memory/raw_ptr.h"
|
2019-05-15 15:04:23 -07:00
|
|
|
#include "components/remote_cocoa/app_shim/views_nswindow_delegate.h"
|
2018-04-19 16:01:19 +09:00
|
|
|
|
|
|
|
namespace electron {
|
|
|
|
class NativeWindowMac;
|
|
|
|
}
|
|
|
|
|
2018-09-19 13:10:26 +02:00
|
|
|
@interface ElectronNSWindowDelegate
|
|
|
|
: ViewsNSWindowDelegate <NSTouchBarDelegate, QLPreviewPanelDataSource> {
|
2018-04-19 16:01:19 +09:00
|
|
|
@private
|
2023-06-13 14:45:48 -04:00
|
|
|
raw_ptr<electron::NativeWindowMac> shell_;
|
2018-04-19 16:01:19 +09:00
|
|
|
bool is_zooming_;
|
|
|
|
int level_;
|
|
|
|
bool is_resizable_;
|
2021-06-01 22:37:10 -04:00
|
|
|
|
2023-07-26 10:10:34 +02:00
|
|
|
// Whether the window is currently minimized. Used to work
|
|
|
|
// around a macOS bug with child window minimization.
|
|
|
|
bool is_minimized_;
|
|
|
|
|
2021-06-01 22:37:10 -04:00
|
|
|
// Only valid during a live resize.
|
|
|
|
// Used to keep track of whether a resize is happening horizontally or
|
|
|
|
// vertically, even if physically the user is resizing in both directions.
|
2024-01-10 23:23:35 +01:00
|
|
|
std::optional<bool> resizingHorizontally_;
|
2018-04-19 16:01:19 +09:00
|
|
|
}
|
|
|
|
- (id)initWithShell:(electron::NativeWindowMac*)shell;
|
|
|
|
@end
|
|
|
|
|
2021-11-22 08:34:31 +01:00
|
|
|
#endif // ELECTRON_SHELL_BROWSER_UI_COCOA_ELECTRON_NS_WINDOW_DELEGATE_H_
|