Merge pull request #1732 from atom/web-preferences

Simplify how we find NativeWindow from WebContents
This commit is contained in:
Cheng Zhao 2015-05-20 10:45:01 +08:00
commit b558485394
4 changed files with 8 additions and 16 deletions

View file

@ -51,9 +51,7 @@ v8::Persistent<v8::ObjectTemplate> template_;
NativeWindow* GetWindowFromGuest(const content::WebContents* guest) {
WebViewManager::WebViewInfo info;
if (WebViewManager::GetInfoForProcess(guest->GetRenderProcessHost(), &info))
return NativeWindow::FromRenderView(
info.embedder->GetRenderProcessHost()->GetID(),
info.embedder->GetRoutingID());
return NativeWindow::FromWebContents(info.embedder);
else
return nullptr;
}