Module callbacks

Module callbacks 

Source
Expand description

Pane-specific CEF callback bodies.

Extracted from client.rs in Phase 4 of the modularization split (see docs/specs/SPEC_BROWSER_PANE_MODULARIZATION.md §6). AgentMuxHandler still owns the CEF callback plumbing; this module holds the pane-branch bodies so pane-specific logic lives in one place instead of threaded through if self.is_browser_pane branches in client.rs.

Notable: this is where install_browser_pane_focus_redirect actually gets wired in. Before this phase the function existed in browser_pane::hwnd but had zero callers (see SPEC_BROWSER_PANE_LIFECYCLE.md §5 race #5). Now on_after_created_browser_pane and on_load_end_browser_pane both reinstall the focus subclass — required because Chromium recreates the Chrome_RenderWidgetHostHWND child on every navigation, stranding the old subclass on a destroyed HWND.

Functions§

on_after_created_browser_pane
Called from AgentMuxHandler::on_after_created when the browser being registered is a pane (label prefix browser-pane-*).
on_before_close_browser_pane
Called from AgentMuxHandler::on_before_close after the browser has been removed from state.browsers and the label has been identified as a pane label (prefix browser-pane-*).
on_load_end_browser_pane
Called from AgentMuxHandler::on_load_end when is_browser_pane is true.
on_loading_state_change_browser_pane
Pane-specific on_loading_state_change body. Called from AgentMuxHandler::on_loading_state_change when is_browser_pane == true.
resolve_pane_block_id 🔒
Resolve the block_id for a pane browser. Panes are registered in state.browsers under labels like browser-pane-<uuid>-<seq>. Find the label whose browser handle matches the given one by is_same, then strip the prefix and the trailing -<seq> to recover the uuid.