bunite-core 0.14.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -108,12 +108,31 @@ struct ViewHost {
108
108
  std::unordered_map<uint32_t, CefRefPtr<CefJSDialogCallback>> pending_dialogs;
109
109
  uint32_t next_dialog_request_id = 1;
110
110
 
111
+ // Download policy: 0=auto, 1=ask, 2=block. Default block.
112
+ std::atomic<int32_t> download_policy{2};
113
+ std::string download_dir;
114
+
115
+ // True for ViewHosts minted by OnBeforePopup; popup_accept binds them to a
116
+ // user window, popup_dismiss destroys them.
117
+ bool is_popup_pending = false;
118
+ // If popup_accept arrives before OnAfterCreated, stash parameters; the
119
+ // browser-create completion applies them.
120
+ struct PendingPopupAccept { uint32_t host_window_id; double x, y, w, h; };
121
+ std::optional<PendingPopupAccept> pending_popup_accept;
122
+ bool popup_dismiss_requested = false;
123
+
111
124
  // Pending state: applied in OnAfterCreated when browser HWND becomes available.
112
125
  bool pending_visible = true;
113
126
  bool pending_bring_to_front = false;
114
127
  bool pending_passthrough = false;
115
128
  bool has_pending_bounds = false;
116
129
  RECT pending_bounds{0, 0, 0, 0};
130
+
131
+ // OOPIF input dispatch — populated by Target.attachedToTarget events after
132
+ // lazy Target.setAutoAttach. frameId → sessionId for flatten:true routing.
133
+ std::atomic<bool> oopif_autoattach_armed = false;
134
+ std::mutex oopif_sessions_mutex;
135
+ std::unordered_map<std::string, std::string> oopif_sessions; // frameId → sessionId
117
136
  };
118
137
 
119
138
  struct WindowHost {
@@ -208,6 +227,9 @@ bool shouldAllowNavigation(const ViewHost* view, const std::string& url);
208
227
  void emitWindowEvent(uint32_t window_id, const char* event_name, const std::string& payload = {});
209
228
  void emitWebviewEvent(uint32_t view_id, const char* event_name, const std::string& payload = {});
210
229
 
230
+ // Bind a popup ViewHost (created by OnBeforePopup) to a user window + bounds.
231
+ void applyPopupAccept(ViewHost* view, uint32_t host_window_id, double x, double y, double w, double h);
232
+
211
233
  std::string normalizeAppResPath(const std::string& url);
212
234
  std::string getMimeType(const std::filesystem::path& file_path);
213
235
  std::string getAppResRootForView(uint32_t view_id);