private static unsafe void OnExtensionUnloadedImpl(cef_extension_handler_t *self, cef_extension_t *extension) { var instance = GetInstance((IntPtr)self) as CefExtensionHandler; if (instance == null || ((ICefExtensionHandlerPrivate)instance).AvoidOnExtensionUnloaded()) { ReleaseIfNonNull((cef_base_ref_counted_t *)extension); return; } instance.OnExtensionUnloaded(CefExtension.Wrap(CefExtension.Create, extension)); }
/// <summary> /// Returns the extension matching |extension_id| or NULL if no matching /// extension is accessible in this context (see HasExtension). This function /// must be called on the browser process UI thread. /// </summary> public unsafe virtual CefExtension GetExtension(string extensionId) { fixed(char *s0 = extensionId) { var cstr0 = new cef_string_t { Str = s0, Length = extensionId != null ? extensionId.Length : 0 }; return(SafeCall(CefExtension.Wrap(CefExtension.Create, NativeInstance->GetExtension(&cstr0)))); } }
/// <summary> /// Called when an extension needs a browser to host a background script /// specified via the "background" manifest key. The browser will have no /// visible window and cannot be displayed. |extension| is the extension that /// is loading the background script. |url| is an internally generated /// reference to an HTML page that will be used to load the background script /// via a /// <script /// > src attribute. To allow creation of the browser optionally /// modify |client| and |settings| and return false (0). To cancel creation of /// the browser (and consequently cancel load of the background script) return /// true (1). Successful creation will be indicated by a call to /// cef_life_span_handler_t::OnAfterCreated, and /// cef_browser_host_t::IsBackgroundHost will return true (1) for the resulting /// browser. See https://developer.chrome.com/extensions/event_pages for more /// information about extension background script usage. /// </summary> protected internal unsafe virtual bool OnBeforeBackgroundBrowser(CefExtension extension, string url, ref CefClient client, CefBrowserSettings settings) { return(default);
/// <summary> /// Called after the cef_extension_t::Unload request has completed. /// </summary> protected internal unsafe virtual void OnExtensionUnloaded(CefExtension extension) { }
/// <summary> /// Returns true (1) if this object is the same extension as |that| object. /// Extensions are considered the same if identifier, path and loader context /// match. /// </summary> public unsafe virtual bool IsSame(CefExtension that) { return(SafeCall(NativeInstance->IsSame((that != null) ? that.GetNativeInstance() : null) != 0)); }
/// <summary> /// Called after the cef_extension_t::Unload request has completed. /// </summary> public unsafe virtual void OnExtensionUnloaded(CefExtension extension) { }