|
3 | 3 | // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
|
4 | 4 |
|
5 | 5 | using System;
|
| 6 | +using System.Collections.Generic; |
6 | 7 |
|
7 | 8 | namespace CefSharp.Handler
|
8 | 9 | {
|
@@ -55,6 +56,43 @@ protected virtual void OnScheduleMessagePumpWork(long delay)
|
55 | 56 |
|
56 | 57 | }
|
57 | 58 |
|
| 59 | + /// <inheritdoc/> |
| 60 | + bool IBrowserProcessHandler.OnAlreadyRunningAppRelaunch(IReadOnlyDictionary<string, string> commandLine, string currentDirectory) |
| 61 | + { |
| 62 | + return OnAlreadyRunningAppRelaunch(commandLine, currentDirectory); |
| 63 | + } |
| 64 | + |
| 65 | + /// <summary> |
| 66 | + /// Implement this method to provide app-specific behavior when an already |
| 67 | + /// running app is relaunched with the same CefSettings.RootCachePath value. |
| 68 | + /// For example, activate an existing app window or create a new app window. |
| 69 | + /// |
| 70 | + /// To avoid cache corruption only a single app instance is allowed to run for |
| 71 | + /// a given CefSettings.RootCachePath value. On relaunch the app checks a |
| 72 | + /// process singleton lock and then forwards the new launch arguments to the |
| 73 | + /// already running app process before exiting early. Client apps should |
| 74 | + /// therefore check the Cef.Initialize() return value for early exit before |
| 75 | + /// proceeding. |
| 76 | + /// |
| 77 | + /// It's important to note that this method will be called on a CEF UI thread, |
| 78 | + /// which by default is not the same as your application UI thread. |
| 79 | + /// |
| 80 | + /// </summary> |
| 81 | + /// <param name="commandLine">Command line arugments/switches</param> |
| 82 | + /// <param name="currentDirectory">current directory (optional)</param> |
| 83 | + /// <returns> |
| 84 | + /// Return true if the relaunch is handled or false for default relaunch |
| 85 | + /// behavior. Default behavior will create a new default styled Chrome window. |
| 86 | + /// </returns> |
| 87 | + /// <remarks> |
| 88 | + /// The <paramref name="commandLine"/> dictionary may contain keys that have empty string values |
| 89 | + /// (arugments). |
| 90 | + /// </remarks> |
| 91 | + protected virtual bool OnAlreadyRunningAppRelaunch(IReadOnlyDictionary<string, string> commandLine, string currentDirectory) |
| 92 | + { |
| 93 | + return false; |
| 94 | + } |
| 95 | + |
58 | 96 | /// <summary>
|
59 | 97 | /// IsDisposed
|
60 | 98 | /// </summary>
|
|
0 commit comments