Simplify how we find NativeWindow from WebContents

This commit is contained in:
Cheng Zhao 2015-05-20 10:27:16 +08:00
parent cda8b119e2
commit 7c69c2846b
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;
}