chrome: Add callback for already running app relaunch (fixes #3609)

Adds a new CefBrowserProcessHandler::OnAlreadyRunningAppRelaunch
callback for when an already running app is relaunched with the
same CefSettings.root_cache_path.

Client apps should check the CefInitialize() return value for early
exit of the relaunch source process.
This commit is contained in:
Marshall Greenblatt
2023-11-28 20:33:44 -05:00
parent e153def017
commit 26e06c4ddc
45 changed files with 553 additions and 178 deletions

View File

@@ -31,9 +31,12 @@ class ClientAppBrowser : public ClientApp, public CefBrowserProcessHandler {
virtual void OnContextInitialized(CefRefPtr<ClientAppBrowser> app) {}
virtual void OnBeforeChildProcessLaunch(
virtual bool OnAlreadyRunningAppRelaunch(
CefRefPtr<ClientAppBrowser> app,
CefRefPtr<CefCommandLine> command_line) {}
CefRefPtr<CefCommandLine> command_line,
const CefString& current_directory) {
return false;
}
virtual CefRefPtr<CefClient> GetDefaultClient(
CefRefPtr<ClientAppBrowser> app) {
@@ -73,8 +76,8 @@ class ClientAppBrowser : public ClientApp, public CefBrowserProcessHandler {
cef_preferences_type_t type,
CefRawPtr<CefPreferenceRegistrar> registrar) override;
void OnContextInitialized() override;
void OnBeforeChildProcessLaunch(
CefRefPtr<CefCommandLine> command_line) override;
bool OnAlreadyRunningAppRelaunch(CefRefPtr<CefCommandLine> command_line,
const CefString& current_directory) override;
void OnScheduleMessagePumpWork(int64_t delay) override;
CefRefPtr<CefClient> GetDefaultClient() override;