Lines Matching full:extension
38 #include "extensions/common/extension.h"
60 // normalized to the extension URL for apps.
77 // on whether a given extension uses "split" or "spanning" incognito behavior.
83 virtual ExtensionHost* CreateBackgroundHost(const Extension* extension,
88 // Returns true if the extension is allowed to run in incognito mode.
89 bool IsIncognitoEnabled(const Extension* extension);
97 ProcessManager* manager, const Extension* extension) {
99 if (BackgroundInfo::HasPersistentBackgroundPage(extension))
100 manager->CreateBackgroundHost(extension,
101 BackgroundInfo::GetBackgroundURL(extension));
140 // This is used with the ShouldSuspend message, to ensure that the extension
245 ExtensionHost* ProcessManager::CreateBackgroundHost(const Extension* extension,
249 if (extension->is_hosted_app() ||
255 // Don't create multiple background hosts for an extension.
256 if (ExtensionHost* host = GetBackgroundHostForExtension(extension->id()))
260 new ExtensionHost(extension, GetSiteInstanceForURL(url), url,
283 Extension::GetBaseURLFromExtensionId(extension_id));
297 const Extension* ProcessManager::GetExtensionForRenderViewHost(
324 const Extension* extension = GetExtensionForRenderViewHost(
326 if (extension)
327 DecrementLazyKeepaliveCount(extension);
332 const Extension* extension = GetExtensionForRenderViewHost(
334 if (!extension)
341 // extension views are visible. Keepalive count balanced in
355 int ProcessManager::GetLazyKeepaliveCount(const Extension* extension) {
356 if (!BackgroundInfo::HasLazyBackgroundPage(extension))
359 return background_page_data_[extension->id()].lazy_keepalive_count;
362 void ProcessManager::IncrementLazyKeepaliveCount(const Extension* extension) {
363 if (!BackgroundInfo::HasLazyBackgroundPage(extension))
366 int& count = background_page_data_[extension->id()].lazy_keepalive_count;
368 OnLazyBackgroundPageActive(extension->id());
371 void ProcessManager::DecrementLazyKeepaliveCount(const Extension* extension) {
372 if (!BackgroundInfo::HasLazyBackgroundPage(extension))
374 DecrementLazyKeepaliveCount(extension->id());
403 const Extension* extension = GetExtensionForRenderViewHost(
405 if (extension)
406 IncrementLazyKeepaliveCount(extension);
411 // a per extension flag. On a regular interval that flag is checked. Changes
413 void ProcessManager::KeepaliveImpulse(const Extension* extension) {
414 if (!BackgroundInfo::HasLazyBackgroundPage(extension))
417 BackgroundPageData& bd = background_page_data_[extension->id()];
422 IncrementLazyKeepaliveCount(extension);
431 // for extension to be shut down based on impulses. Worst case is an impulse
462 // extension remains idle until the renderer responds with an ACK, then we
463 // know that the extension process is ready to shut down. If our
515 IncrementLazyKeepaliveCount(host->extension());
522 DecrementLazyKeepaliveCount(host->extension());
525 void ProcessManager::CancelSuspend(const Extension* extension) {
526 bool& is_closing = background_page_data_[extension->id()].is_closing;
527 ExtensionHost* host = GetBackgroundHostForExtension(extension->id());
531 new ExtensionMsg_CancelSuspend(extension->id()));
536 IncrementLazyKeepaliveCount(extension);
537 DecrementLazyKeepaliveCount(extension);
545 // This browser has no extension service. In this case,
578 const Extension* extension =
579 content::Details<const Extension>(details).ptr();
580 CreateBackgroundHostForExtensionLoad(this, extension);
586 const Extension* extension =
587 content::Details<UnloadedExtensionInfo>(details)->extension;
591 if (host->extension_id() == extension->id()) {
596 UnregisterExtension(extension->id());
603 ClearBackgroundPageData(host->extension()->id());
604 background_page_data_[host->extension()->id()].since_suspended.reset(
621 // navigation away from an extension URL). For the replaced case, we must
645 const Extension* extension = GetExtensionForRenderViewHost(
647 if (!extension)
684 const Extension* extension = GetExtensionForRenderViewHost(rvh);
685 if (!extension)
689 CancelSuspend(extension);
690 IncrementLazyKeepaliveCount(extension);
692 DecrementLazyKeepaliveCount(extension);
706 for (ExtensionSet::const_iterator extension = service->extensions()->begin();
707 extension != service->extensions()->end(); ++extension) {
708 CreateBackgroundHostForExtensionLoad(this, extension->get());
711 (*extension)->id());
741 if (BackgroundInfo::HasLazyBackgroundPage(host->extension())) {
743 background_page_data_[host->extension()->id()].
770 // RenderViewHosts are still alive. During extension reloading, they will
771 // decrement the lazy_keepalive_count to negative for the new extension
773 // data for the unloaded extension, unregister the RenderViewHosts too.
791 // Re-register all RenderViews for this extension. We do this to restore
830 const Extension* extension, const GURL& url) {
831 if (IncognitoInfo::IsSplitMode(extension)) {
832 if (IsIncognitoEnabled(extension))
833 return ProcessManager::CreateBackgroundHost(extension, url);
835 // Do nothing. If an extension is spanning, then its original-profile
845 const Extension* extension =
847 if (extension && !IncognitoInfo::IsSplitMode(extension)) {
854 bool IncognitoProcessManager::IsIncognitoEnabled(const Extension* extension) {
858 return extension_util::IsIncognitoEnabled(extension->id(), service);