| 
									
										
										
										
											2018-05-02 15:39:43 +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/root_view_mac.h" | 
					
						
							| 
									
										
										
										
											2018-05-02 15:39:43 +09:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-06-19 13:46:59 -07:00
										 |  |  | #include "shell/browser/native_window.h" | 
					
						
							| 
									
										
										
										
											2018-05-02 15:39:43 +09:00
										 |  |  | 
 | 
					
						
							|  |  |  | namespace electron { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | RootViewMac::RootViewMac(NativeWindow* window) : window_(window) { | 
					
						
							|  |  |  |   set_owned_by_client(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-03 21:16:13 -07:00
										 |  |  | RootViewMac::~RootViewMac() = default; | 
					
						
							| 
									
										
										
										
											2018-05-02 15:39:43 +09:00
										 |  |  | 
 | 
					
						
							|  |  |  | void RootViewMac::Layout() { | 
					
						
							| 
									
										
										
										
											2018-05-08 15:24:53 +09:00
										 |  |  |   if (!window_->content_view())  // Not ready yet. | 
					
						
							| 
									
										
										
										
											2018-05-02 15:39:43 +09:00
										 |  |  |     return; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-08 15:24:53 +09:00
										 |  |  |   window_->content_view()->SetBoundsRect(gfx::Rect(gfx::Point(), size())); | 
					
						
							| 
									
										
										
										
											2018-05-02 15:39:43 +09:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | gfx::Size RootViewMac::GetMinimumSize() const { | 
					
						
							|  |  |  |   return window_->GetMinimumSize(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | gfx::Size RootViewMac::GetMaximumSize() const { | 
					
						
							|  |  |  |   return window_->GetMaximumSize(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | }  // namespace electron |