2018-04-19 15:36:14 +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.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-06-19 13:46:59 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#include "shell/browser/ui/cocoa/electron_native_widget_mac.h"
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-19 15:36:14 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2022-06-14 17:24:52 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#include <string>
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#include "shell/browser/ui/cocoa/electron_ns_panel.h"
							 | 
						
					
						
							
								
									
										
										
										
											2019-06-19 13:46:59 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#include "shell/browser/ui/cocoa/electron_ns_window.h"
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-24 17:23:08 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-19 15:36:14 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								namespace electron {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								ElectronNativeWidgetMac::ElectronNativeWidgetMac(
							 | 
						
					
						
							
								
									
										
										
										
											2018-05-02 21:28:28 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    NativeWindowMac* shell,
							 | 
						
					
						
							
								
									
										
										
										
											2022-06-14 17:24:52 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    const std::string& window_type,
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-24 17:23:08 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    NSUInteger style_mask,
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-19 15:36:14 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    views::internal::NativeWidgetDelegate* delegate)
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-24 17:23:08 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    : views::NativeWidgetMac(delegate),
							 | 
						
					
						
							
								
									
										
										
										
											2018-05-02 21:28:28 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								      shell_(shell),
							 | 
						
					
						
							
								
									
										
										
										
											2022-06-14 17:24:52 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								      window_type_(window_type),
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-24 17:23:08 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								      style_mask_(style_mask) {}
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-19 15:36:14 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2021-06-03 21:16:13 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								ElectronNativeWidgetMac::~ElectronNativeWidgetMac() = default;
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-19 15:36:14 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-19 16:01:19 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								NativeWidgetMacNSWindow* ElectronNativeWidgetMac::CreateNSWindow(
							 | 
						
					
						
							
								
									
										
										
										
											2019-05-22 12:56:21 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    const remote_cocoa::mojom::CreateWindowParams* params) {
							 | 
						
					
						
							
								
									
										
										
										
											2022-06-14 17:24:52 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  if (window_type_ == "panel") {
							 | 
						
					
						
							
								
									
										
										
										
											2023-08-04 10:47:29 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    return [[ElectronNSPanel alloc] initWithShell:shell_ styleMask:style_mask_];
							 | 
						
					
						
							
								
									
										
										
										
											2022-06-14 17:24:52 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  } else {
							 | 
						
					
						
							
								
									
										
										
										
											2023-08-04 10:47:29 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    return [[ElectronNSWindow alloc] initWithShell:shell_
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                                         styleMask:style_mask_];
							 | 
						
					
						
							
								
									
										
										
										
											2022-06-14 17:24:52 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  }
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-19 15:36:14 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								}  // namespace electron
							 |