1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-05-13 21:46:53 +02:00
CEF4Delphi/docs/html/uCEFInterfaces.ICefFrameHandler.html

205 lines
14 KiB
HTML
Raw Permalink Normal View History

2024-02-24 12:01:31 +01:00
<!DOCTYPE html>
<html lang="en">
<head>
<title>cef4delphi: uCEFInterfaces: Interface ICefFrameHandler</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="generator" content="PasDoc 0.16.0-snapshot">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="StyleSheet" type="text/css" href="pasdoc.css">
</head>
<body>
<span id="ICefFrameHandler"></span><h1 class="cio">Interface ICefFrameHandler</h1>
<div class="sections">
<div class="one_section"><a class="section" href="#PasDoc-Description">Description</a></div><div class="one_section"><a class="section" href="#PasDoc-Hierarchy">Hierarchy</a></div><div class="one_section">Fields</div><div class="one_section"><a class="section" href="#PasDoc-Methods">Methods</a></div><div class="one_section">Properties</div></div>
<span id="PasDoc-Description"></span><h2 class="unit">Unit</h2>
<p class="unitlink">
<a href="uCEFInterfaces.html">uCEFInterfaces</a></p>
<h2 class="declaration">Declaration</h2>
<p class="declaration">
<code>type ICefFrameHandler = interface(<a class="normal" href="uCEFInterfaces.ICefBaseRefCounted.html">ICefBaseRefCounted</a>)</code></p>
<h2 class="description">Description</h2>
<p>
2024-12-05 12:52:51 +01:00
<p>Implement this structure to handle events related to cef_frame_t life span. The order of callbacks is:
2024-02-24 12:01:31 +01:00
2024-12-05 12:52:51 +01:00
<p>(1) During initial cef_browser_host_t creation and navigation of the main frame:
2024-02-24 12:01:31 +01:00
2024-12-05 12:52:51 +01:00
<p></p>
2024-02-24 12:01:31 +01:00
2024-12-05 12:52:51 +01:00
<pre class="preformatted">
- cef_frame_handler_t::OnFrameCreated =&gt; The initial main frame object has
been created. Any commands will be queued until the frame is attached.
- cef_frame_handler_t::OnMainFrameChanged =&gt; The initial main frame object
has been assigned to the browser.
- cef_life_span_handler_t::OnAfterCreated =&gt; The browser is now valid and
can be used.
- cef_frame_handler_t::OnFrameAttached =&gt; The initial main frame object is
now connected to its peer in the renderer process. Commands can be routed.</pre>
<p>
<p>(2) During further cef_browser_host_t navigation/loading of the main frame and/or sub-frames:
<p></p>
<pre class="preformatted">
- cef_frame_handler_t::OnFrameCreated =&gt; A new main frame or sub-frame
object has been created. Any commands will be queued until the frame is
attached.
- cef_frame_handler_t::OnFrameAttached =&gt; A new main frame or sub-frame
object is now connected to its peer in the renderer process. Commands can
be routed.
- cef_frame_handler_t::OnFrameDetached =&gt; An existing main frame or sub-
frame object has lost its connection to the renderer process. If multiple
objects are detached at the same time then notifications will be sent for
any sub-frame objects before the main frame object. Commands can no longer
be routed and will be discarded.
- CefFremeHadler::OnFrameDestroyed =&gt; An existing main frame or sub-frame
object has been destroyed.
- cef_frame_handler_t::OnMainFrameChanged =&gt; A new main frame object has
been assigned to the browser. This will only occur with cross-origin
navigation or re-navigation after renderer process termination (due to
crashes, etc).</pre>
<p>
2024-02-24 12:01:31 +01:00
2024-12-05 12:52:51 +01:00
<p>(3) During final cef_browser_host_t destruction of the main frame:
2024-02-24 12:01:31 +01:00
2024-12-05 12:52:51 +01:00
<p></p>
2024-02-24 12:01:31 +01:00
2024-12-05 12:52:51 +01:00
<pre class="preformatted">
- cef_frame_handler_t::OnFrameDetached =&gt; Any sub-frame objects have lost
their connection to the renderer process. Commands can no longer be routed
and will be discarded.
- CefFreameHandler::OnFrameDestroyed =&gt; Any sub-frame objects have been
destroyed.
- cef_life_span_handler_t::OnBeforeClose =&gt; The browser has been destroyed.
- cef_frame_handler_t::OnFrameDetached =&gt; The main frame object have lost
its connection to the renderer process. Notifications will be sent for any
sub-frame objects before the main frame object. Commands can no longer be
routed and will be discarded.
- CefFreameHandler::OnFrameDestroyed =&gt; The main frame object has been
destroyed.
- cef_frame_handler_t::OnMainFrameChanged =&gt; The final main frame object has
been removed from the browser.</pre>
2024-02-24 12:01:31 +01:00
2024-12-05 12:52:51 +01:00
<p>
<p>Special handling applies for cross-origin loading on creation/navigation of sub-frames, and cross-origin loading on creation of new popup browsers. A temporary frame will first be created in the parent frame's renderer process. This temporary frame will never attach and will be discarded after the real cross-origin frame is created in the new/target renderer process. The client will receive creation callbacks for the temporary frame, followed by cross-origin navigation callbacks (2) for the transition from the temporary frame to the real frame. The temporary frame will not receive or execute commands during this transitional period (any sent commands will be discarded).
<p>When the main frame navigates to a different origin the OnMainFrameChanged callback (2) will be executed with the old and new main frame objects.
<p>Callbacks will not be executed for placeholders that may be created during pre-commit navigation for sub-frames that do not yet exist in the renderer process. Placeholders will have cef_frame_t::get_identifier() == -4.
<p>The functions of this structure will be called on the UI thread unless otherwise indicated.
<p></p>
2024-02-24 12:01:31 +01:00
<p>
<p>UNKNOWN
<p>&lt;see href=&quot;<a href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_frame_handler_capi.h">https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_frame_handler_capi.h</a>&quot;&gt;CEF source file: /include/capi/cef_frame_handler_capi.h (cef_frame_handler_t))</p>
<span id="PasDoc-Hierarchy"></span><h2 class="hierarchy">Hierarchy</h2>
<ul class="hierarchy"><li class="ancestor">IInterface</li>
<li class="ancestor"><a class="normal" href="uCEFInterfaces.ICefBaseRefCounted.html">ICefBaseRefCounted</a></li>
<li class="thisitem">ICefFrameHandler</li></ul><h2 class="overview">Overview</h2>
<span id="PasDoc-Methods"></span><h3 class="summary">Methods</h3>
<table class="summary wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>procedure <strong><a href="uCEFInterfaces.ICefFrameHandler.html#OnFrameCreated-ICefBrowser-ICefFrame-">OnFrameCreated</a></strong>(const browser: <a href="uCEFInterfaces.ICefBrowser.html">ICefBrowser</a>; const frame: <a href="uCEFInterfaces.ICefFrame.html">ICefFrame</a>);</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
2024-12-05 12:52:51 +01:00
<td class="itemcode"><code>procedure <strong><a href="uCEFInterfaces.ICefFrameHandler.html#OnFrameDestroyed-ICefBrowser-ICefFrame-">OnFrameDestroyed</a></strong>(const browser: <a href="uCEFInterfaces.ICefBrowser.html">ICefBrowser</a>; const frame: <a href="uCEFInterfaces.ICefFrame.html">ICefFrame</a>);</code></td>
2024-02-24 12:01:31 +01:00
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
2024-12-05 12:52:51 +01:00
<td class="itemcode"><code>procedure <strong><a href="uCEFInterfaces.ICefFrameHandler.html#OnFrameAttached-ICefBrowser-ICefFrame-boolean-">OnFrameAttached</a></strong>(const browser: <a href="uCEFInterfaces.ICefBrowser.html">ICefBrowser</a>; const frame: <a href="uCEFInterfaces.ICefFrame.html">ICefFrame</a>; reattached: boolean);</code></td>
2024-02-24 12:01:31 +01:00
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
2024-12-05 12:52:51 +01:00
<td class="itemcode"><code>procedure <strong><a href="uCEFInterfaces.ICefFrameHandler.html#OnFrameDetached-ICefBrowser-ICefFrame-">OnFrameDetached</a></strong>(const browser: <a href="uCEFInterfaces.ICefBrowser.html">ICefBrowser</a>; const frame: <a href="uCEFInterfaces.ICefFrame.html">ICefFrame</a>);</code></td>
2024-02-24 12:01:31 +01:00
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
2024-12-05 12:52:51 +01:00
<td class="itemcode"><code>procedure <strong><a href="uCEFInterfaces.ICefFrameHandler.html#OnMainFrameChanged-ICefBrowser-ICefFrame-ICefFrame-">OnMainFrameChanged</a></strong>(const browser: <a href="uCEFInterfaces.ICefBrowser.html">ICefBrowser</a>; const old_frame, new_frame: <a href="uCEFInterfaces.ICefFrame.html">ICefFrame</a>);</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
2024-02-24 12:01:31 +01:00
<td class="itemcode"><code>procedure <strong><a href="uCEFInterfaces.ICefFrameHandler.html#RemoveReferences">RemoveReferences</a></strong>;</code></td>
</tr>
</table>
<h2 class="description">Description</h2>
<h3 class="detail">Methods</h3>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="OnFrameCreated-ICefBrowser-ICefFrame-"></span><code>procedure <strong>OnFrameCreated</strong>(const browser: <a href="uCEFInterfaces.ICefBrowser.html">ICefBrowser</a>; const frame: <a href="uCEFInterfaces.ICefFrame.html">ICefFrame</a>);</code></td>
</tr>
<tr><td colspan="2">
<p>
2024-12-05 12:52:51 +01:00
Called when a new frame is created. This will be the first notification that references |frame|. Any commands that require transport to the associated renderer process (LoadRequest, SendProcessMessage, GetSource, etc.) will be queued. The queued commands will be sent before OnFrameAttached or discarded before OnFrameDestroyed if the frame never attaches. </p>
2024-02-24 12:01:31 +01:00
<h6 class="description_section">Attributes</h6>
<dl class="attributes">
<dt>GUID['{B437128C-F7CB-4F75-83CF-A257B98C0B6E}']</dt>
<dd></dd>
</dl>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
2024-12-05 12:52:51 +01:00
<td class="itemcode"><span id="OnFrameDestroyed-ICefBrowser-ICefFrame-"></span><code>procedure <strong>OnFrameDestroyed</strong>(const browser: <a href="uCEFInterfaces.ICefBrowser.html">ICefBrowser</a>; const frame: <a href="uCEFInterfaces.ICefFrame.html">ICefFrame</a>);</code></td>
</tr>
<tr><td colspan="2">
<p>
Called when an existing frame is destroyed. This will be the last notification that references |frame| and cef_frame_t::is_valid() will return false (0) for |frame|. If called during browser destruction and after cef_life_span_handler_t::on_before_close() then cef_browser_t::is_valid() will return false (0) for |browser|. Any queued commands that have not been sent will be discarded before this callback. </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
2024-02-24 12:01:31 +01:00
<td class="itemcode"><span id="OnFrameAttached-ICefBrowser-ICefFrame-boolean-"></span><code>procedure <strong>OnFrameAttached</strong>(const browser: <a href="uCEFInterfaces.ICefBrowser.html">ICefBrowser</a>; const frame: <a href="uCEFInterfaces.ICefFrame.html">ICefFrame</a>; reattached: boolean);</code></td>
</tr>
<tr><td colspan="2">
<p>
2024-12-05 12:52:51 +01:00
Called when a frame can begin routing commands to/from the associated renderer process. |reattached| will be true (1) if the frame was re- attached after exiting the BackForwardCache or after encountering a recoverable connection error. Any queued commands will now have been dispatched. This function will not be called for temporary frames created during cross-origin navigation. </p>
2024-02-24 12:01:31 +01:00
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="OnFrameDetached-ICefBrowser-ICefFrame-"></span><code>procedure <strong>OnFrameDetached</strong>(const browser: <a href="uCEFInterfaces.ICefBrowser.html">ICefBrowser</a>; const frame: <a href="uCEFInterfaces.ICefFrame.html">ICefFrame</a>);</code></td>
</tr>
<tr><td colspan="2">
<p>
2024-12-05 12:52:51 +01:00
Called when a frame loses its connection to the renderer process. This may occur when a frame is destroyed, enters the BackForwardCache, or encounters a rare connection error. In the case of frame destruction this call will be followed by a (potentially async) call to OnFrameDestroyed. If frame destruction is occuring synchronously then cef_frame_t::is_valid() will return false (0) for |frame|. If called during browser destruction and after cef_life_span_handler_t::on_before_close() then cef_browser_t::is_valid() will return false (0) for |browser|. If, in the non-destruction case, the same frame later exits the BackForwardCache or recovers from a connection error then there will be a follow-up call to OnFrameAttached. This function will not be called for temporary frames created during cross- origin navigation. </p>
2024-02-24 12:01:31 +01:00
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="OnMainFrameChanged-ICefBrowser-ICefFrame-ICefFrame-"></span><code>procedure <strong>OnMainFrameChanged</strong>(const browser: <a href="uCEFInterfaces.ICefBrowser.html">ICefBrowser</a>; const old_frame, new_frame: <a href="uCEFInterfaces.ICefFrame.html">ICefFrame</a>);</code></td>
</tr>
<tr><td colspan="2">
<p>
2024-12-05 12:52:51 +01:00
Called when the main frame changes due to (a) initial browser creation, (b) final browser destruction, (c) cross-origin navigation or (d) re- navigation after renderer process termination (due to crashes, etc). |old_frame| will be NULL and |new_frame| will be non-NULL when a main frame is assigned to |browser| for the first time. |old_frame| will be non-NULL and |new_frame| will be NULL when a main frame is removed from |browser| for the last time. Both |old_frame| and |new_frame| will be non- NULL for cross-origin navigations or re-navigation after renderer process termination. This function will be called after on_frame_created() for |new_frame| and/or after on_frame_destroyed() for |old_frame|. If called during browser destruction and after cef_life_span_handler_t::on_before_close() then cef_browser_t::is_valid() will return false (0) for |browser|. </p>
2024-02-24 12:01:31 +01:00
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="RemoveReferences"></span><code>procedure <strong>RemoveReferences</strong>;</code></td>
</tr>
<tr><td colspan="2">
<p>
Custom procedure to clear all references. </p>
</td></tr>
</table>
<hr><span class="appinfo"><em>Generated by <a href="https://pasdoc.github.io/">PasDoc 0.16.0-snapshot</a>. </em>
</span>
</body></html>