mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
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:
@@ -11,6 +11,8 @@
|
||||
#include "include/cef_file_util.h"
|
||||
#include "tests/cefclient/browser/client_prefs.h"
|
||||
#include "tests/cefclient/browser/default_client_handler.h"
|
||||
#include "tests/cefclient/browser/main_context.h"
|
||||
#include "tests/cefclient/browser/root_window_manager.h"
|
||||
#include "tests/shared/common/client_switches.h"
|
||||
|
||||
namespace client {
|
||||
@@ -62,6 +64,20 @@ class ClientBrowserDelegate : public ClientAppBrowser::Delegate {
|
||||
}
|
||||
}
|
||||
|
||||
bool OnAlreadyRunningAppRelaunch(
|
||||
CefRefPtr<ClientAppBrowser> app,
|
||||
CefRefPtr<CefCommandLine> command_line,
|
||||
const CefString& current_directory) override {
|
||||
// Create a new root window based on |command_line|.
|
||||
auto config = std::make_unique<RootWindowConfig>(command_line->Copy());
|
||||
|
||||
MainContext::Get()->GetRootWindowManager()->CreateRootWindow(
|
||||
std::move(config));
|
||||
|
||||
// Relaunch was handled.
|
||||
return true;
|
||||
}
|
||||
|
||||
CefRefPtr<CefClient> GetDefaultClient(
|
||||
CefRefPtr<ClientAppBrowser> app) override {
|
||||
// Default client handler for unmanaged browser windows. Used with the
|
||||
|
Reference in New Issue
Block a user