fix: allow docking DevTools with WCO (#35754)
fix: allow for docking devtools with WCO
This commit is contained in:
		
					parent
					
						
							
								4ffdd284c3
							
						
					
				
			
			
				commit
				
					
						eb3262cd87
					
				
			
		
					 1 changed files with 9 additions and 8 deletions
				
			
		| 
						 | 
				
			
			@ -2424,14 +2424,6 @@ void WebContents::OpenDevTools(gin::Arguments* args) {
 | 
			
		|||
      !owner_window()) {
 | 
			
		||||
    state = "detach";
 | 
			
		||||
  }
 | 
			
		||||
  bool activate = true;
 | 
			
		||||
  if (args && args->Length() == 1) {
 | 
			
		||||
    gin_helper::Dictionary options;
 | 
			
		||||
    if (args->GetNext(&options)) {
 | 
			
		||||
      options.Get("mode", &state);
 | 
			
		||||
      options.Get("activate", &activate);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
#if BUILDFLAG(IS_WIN)
 | 
			
		||||
  auto* win = static_cast<NativeWindowViews*>(owner_window());
 | 
			
		||||
| 
						 | 
				
			
			@ -2441,6 +2433,15 @@ void WebContents::OpenDevTools(gin::Arguments* args) {
 | 
			
		|||
    state = "detach";
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  bool activate = true;
 | 
			
		||||
  if (args && args->Length() == 1) {
 | 
			
		||||
    gin_helper::Dictionary options;
 | 
			
		||||
    if (args->GetNext(&options)) {
 | 
			
		||||
      options.Get("mode", &state);
 | 
			
		||||
      options.Get("activate", &activate);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  DCHECK(inspectable_web_contents_);
 | 
			
		||||
  inspectable_web_contents_->SetDockState(state);
 | 
			
		||||
  inspectable_web_contents_->ShowDevTools(activate);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue