Don't rely on process_id to search for NativeWindow

This commit is contained in:
Cheng Zhao 2015-06-03 14:08:56 +08:00
parent 6dfa7b5383
commit d4be2da70e
7 changed files with 36 additions and 65 deletions

View file

@ -85,7 +85,7 @@ v8::Persistent<v8::ObjectTemplate> template_;
// Get the window that has the |guest| embedded.
NativeWindow* GetWindowFromGuest(const content::WebContents* guest) {
WebViewManager::WebViewInfo info;
if (WebViewManager::GetInfoForProcess(guest->GetRenderProcessHost(), &info))
if (WebViewManager::GetInfoForWebContents(guest, &info))
return NativeWindow::FromWebContents(info.embedder);
else
return nullptr;