A little clean up
This commit is contained in:
		
					parent
					
						
							
								c21c89c0ce
							
						
					
				
			
			
				commit
				
					
						071a55974a
					
				
			
		
					 2 changed files with 8 additions and 7 deletions
				
			
		|  | @ -39,13 +39,13 @@ v8::Persistent<v8::ObjectTemplate> template_; | |||
| 
 | ||||
| // Get the window that has the |guest| embedded.
 | ||||
| NativeWindow* GetWindowFromGuest(const content::WebContents* guest) { | ||||
|   auto process = guest->GetRenderProcessHost(); | ||||
|   WebViewManager::WebViewInfo info; | ||||
|   if (WebViewManager::GetInfoForProcess(process, &info)) | ||||
|   if (WebViewManager::GetInfoForProcess(guest->GetRenderProcessHost(), &info)) | ||||
|     return NativeWindow::FromRenderView( | ||||
|         info.embedder->GetRenderProcessHost()->GetID(), | ||||
|         info.embedder->GetRoutingID()); | ||||
|   else | ||||
|     return nullptr; | ||||
|   return NativeWindow::FromRenderView( | ||||
|       info.embedder->GetRenderProcessHost()->GetID(), | ||||
|       info.embedder->GetRoutingID()); | ||||
| } | ||||
| 
 | ||||
| }  // namespace
 | ||||
|  |  | |||
|  | @ -3,9 +3,9 @@ | |||
| // found in the LICENSE file.
 | ||||
| 
 | ||||
| #include "atom/browser/api/atom_api_web_contents.h" | ||||
| #include "atom/browser/atom_browser_context.h" | ||||
| #include "atom/browser/web_view_manager.h" | ||||
| #include "atom/common/native_mate_converters/gurl_converter.h" | ||||
| #include "content/public/browser/browser_context.h" | ||||
| #include "native_mate/dictionary.h" | ||||
| #include "net/base/filename_util.h" | ||||
| 
 | ||||
|  | @ -56,8 +56,9 @@ atom::WebViewManager* GetWebViewManager(content::WebContents* web_contents) { | |||
|   if (context) { | ||||
|     auto manager = context->GetGuestManager(); | ||||
|     return static_cast<atom::WebViewManager*>(manager); | ||||
|   } else { | ||||
|     return nullptr; | ||||
|   } | ||||
|   return nullptr; | ||||
| } | ||||
| 
 | ||||
| void AddGuest(int guest_instance_id, | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Cheng Zhao
				Cheng Zhao