views: Fix crash when setSizeConstrains is called early
This commit is contained in:
		
					parent
					
						
							
								f52c4af605
							
						
					
				
			
			
				commit
				
					
						6aec8b092c
					
				
			
		
					 1 changed files with 4 additions and 1 deletions
				
			
		|  | @ -390,6 +390,9 @@ gfx::Size NativeWindowViews::GetContentSize() { | ||||||
| void NativeWindowViews::SetContentSizeConstraints( | void NativeWindowViews::SetContentSizeConstraints( | ||||||
|     const extensions::SizeConstraints& size_constraints) { |     const extensions::SizeConstraints& size_constraints) { | ||||||
|   NativeWindow::SetContentSizeConstraints(size_constraints); |   NativeWindow::SetContentSizeConstraints(size_constraints); | ||||||
|  |   // widget_delegate() is only available after Init() is called, we make use of
 | ||||||
|  |   // this to determine whether native widget has initialized.
 | ||||||
|  |   if (window_ && window_->widget_delegate()) | ||||||
|     window_->OnSizeConstraintsChanged(); |     window_->OnSizeConstraintsChanged(); | ||||||
| #if defined(USE_X11) | #if defined(USE_X11) | ||||||
|   if (resizable_) |   if (resizable_) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Cheng Zhao
				Cheng Zhao