Avoid using global BrowserContext
This commit is contained in:
parent
502c0f0df7
commit
2c61070b36
4 changed files with 34 additions and 25 deletions
|
@ -39,10 +39,9 @@ v8::Persistent<v8::ObjectTemplate> template_;
|
|||
|
||||
// Get the window that has the |guest| embedded.
|
||||
NativeWindow* GetWindowFromGuest(const content::WebContents* guest) {
|
||||
auto manager = AtomBrowserContext::Get()->GetGuestManager();
|
||||
int guest_process_id = guest->GetRenderProcessHost()->GetID();
|
||||
auto process = guest->GetRenderProcessHost();
|
||||
WebViewManager::WebViewInfo info;
|
||||
if (!static_cast<WebViewManager*>(manager)->GetInfo(guest_process_id, &info))
|
||||
if (WebViewManager::GetInfoForProcess(process, &info))
|
||||
return nullptr;
|
||||
return NativeWindow::FromRenderView(
|
||||
info.embedder->GetRenderProcessHost()->GetID(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue