Get hidden state by using parent window directly
This commit is contained in:
parent
69c69880e5
commit
583bb49f6c
6 changed files with 41 additions and 25 deletions
|
@ -6,7 +6,6 @@
|
|||
|
||||
#include "atom/browser/atom_browser_context.h"
|
||||
#include "content/public/browser/render_process_host.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
|
||||
namespace atom {
|
||||
|
||||
|
@ -42,6 +41,13 @@ void WebViewManager::RemoveGuest(int guest_instance_id) {
|
|||
}
|
||||
}
|
||||
|
||||
content::WebContents* WebViewManager::GetEmbedder(int guest_instance_id) {
|
||||
if (ContainsKey(web_contents_embedder_map_, guest_instance_id))
|
||||
return web_contents_embedder_map_[guest_instance_id].embedder;
|
||||
else
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
content::WebContents* WebViewManager::GetGuestByInstanceID(
|
||||
int owner_process_id,
|
||||
int element_instance_id) {
|
||||
|
@ -65,4 +71,16 @@ bool WebViewManager::ForEachGuest(content::WebContents* embedder_web_contents,
|
|||
return false;
|
||||
}
|
||||
|
||||
// static
|
||||
WebViewManager* WebViewManager::GetWebViewManager(content::WebContents* web_contents) {
|
||||
auto context = web_contents->GetBrowserContext();
|
||||
if (context) {
|
||||
auto manager = context->GetGuestManager();
|
||||
return static_cast<atom::WebViewManager*>(manager);
|
||||
} else {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} // namespace atom
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue