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.
 | // Get the window that has the |guest| embedded.
 | ||||||
| NativeWindow* GetWindowFromGuest(const content::WebContents* guest) { | NativeWindow* GetWindowFromGuest(const content::WebContents* guest) { | ||||||
|   auto process = guest->GetRenderProcessHost(); |  | ||||||
|   WebViewManager::WebViewInfo info; |   WebViewManager::WebViewInfo info; | ||||||
|   if (WebViewManager::GetInfoForProcess(process, &info)) |   if (WebViewManager::GetInfoForProcess(guest->GetRenderProcessHost(), &info)) | ||||||
|     return nullptr; |  | ||||||
|     return NativeWindow::FromRenderView( |     return NativeWindow::FromRenderView( | ||||||
|         info.embedder->GetRenderProcessHost()->GetID(), |         info.embedder->GetRenderProcessHost()->GetID(), | ||||||
|         info.embedder->GetRoutingID()); |         info.embedder->GetRoutingID()); | ||||||
|  |   else | ||||||
|  |     return nullptr; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| }  // namespace
 | }  // namespace
 | ||||||
|  |  | ||||||
|  | @ -3,9 +3,9 @@ | ||||||
| // found in the LICENSE file.
 | // found in the LICENSE file.
 | ||||||
| 
 | 
 | ||||||
| #include "atom/browser/api/atom_api_web_contents.h" | #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/browser/web_view_manager.h" | ||||||
| #include "atom/common/native_mate_converters/gurl_converter.h" | #include "atom/common/native_mate_converters/gurl_converter.h" | ||||||
|  | #include "content/public/browser/browser_context.h" | ||||||
| #include "native_mate/dictionary.h" | #include "native_mate/dictionary.h" | ||||||
| #include "net/base/filename_util.h" | #include "net/base/filename_util.h" | ||||||
| 
 | 
 | ||||||
|  | @ -56,9 +56,10 @@ atom::WebViewManager* GetWebViewManager(content::WebContents* web_contents) { | ||||||
|   if (context) { |   if (context) { | ||||||
|     auto manager = context->GetGuestManager(); |     auto manager = context->GetGuestManager(); | ||||||
|     return static_cast<atom::WebViewManager*>(manager); |     return static_cast<atom::WebViewManager*>(manager); | ||||||
|   } |   } else { | ||||||
|     return nullptr; |     return nullptr; | ||||||
|   } |   } | ||||||
|  | } | ||||||
| 
 | 
 | ||||||
| void AddGuest(int guest_instance_id, | void AddGuest(int guest_instance_id, | ||||||
|               int element_instance_id, |               int element_instance_id, | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Cheng Zhao
				Cheng Zhao